clear some warnings

This commit is contained in:
Greg Johnston 2024-04-27 11:52:38 -04:00
parent e68730d15f
commit 53b22a9b74
22 changed files with 61 additions and 128 deletions

View File

@ -57,13 +57,13 @@ use leptos::{
IntoView, IntoView,
}; };
use leptos_meta::{MetaContext, ServerMetaContext}; use leptos_meta::{MetaContext, ServerMetaContext};
use once_cell::sync::OnceCell; use leptos_router::{
use parking_lot::RwLock;
use reactive_graph::owner::Sandboxed;
use routing::{
location::RequestUrl, PathSegment, RouteList, RouteListing, SsrMode, location::RequestUrl, PathSegment, RouteList, RouteListing, SsrMode,
StaticDataMap, StaticMode, StaticDataMap, StaticMode,
}; };
use once_cell::sync::OnceCell;
use parking_lot::RwLock;
use reactive_graph::owner::Sandboxed;
use server_fn::{ use server_fn::{
error::{NoCustomError, ServerFnErrorSerde}, error::{NoCustomError, ServerFnErrorSerde},
@ -1149,7 +1149,7 @@ where
pub struct AxumRouteListing { pub struct AxumRouteListing {
path: String, path: String,
mode: SsrMode, mode: SsrMode,
methods: Vec<routing::Method>, methods: Vec<leptos_router::Method>,
static_mode: Option<(StaticMode, StaticDataMap)>, static_mode: Option<(StaticMode, StaticDataMap)>,
} }
@ -1178,7 +1178,7 @@ impl AxumRouteListing {
pub fn new( pub fn new(
path: String, path: String,
mode: SsrMode, mode: SsrMode,
methods: impl IntoIterator<Item = routing::Method>, methods: impl IntoIterator<Item = leptos_router::Method>,
static_mode: Option<(StaticMode, StaticDataMap)>, static_mode: Option<(StaticMode, StaticDataMap)>,
) -> Self { ) -> Self {
Self { Self {
@ -1200,7 +1200,7 @@ impl AxumRouteListing {
} }
/// The HTTP request methods this path can handle. /// The HTTP request methods this path can handle.
pub fn methods(&self) -> impl Iterator<Item = routing::Method> + '_ { pub fn methods(&self) -> impl Iterator<Item = leptos_router::Method> + '_ {
self.methods.iter().copied() self.methods.iter().copied()
} }
@ -1249,7 +1249,7 @@ where
vec![AxumRouteListing::new( vec![AxumRouteListing::new(
"/".to_string(), "/".to_string(),
Default::default(), Default::default(),
[routing::Method::Get], [leptos_router::Method::Get],
None, None,
)] )]
} else { } else {
@ -1405,7 +1405,7 @@ fn static_route<IV, S>(
options: LeptosOptions, options: LeptosOptions,
app_fn: impl Fn() -> IV + Clone + Send + 'static, app_fn: impl Fn() -> IV + Clone + Send + 'static,
additional_context: impl Fn() + Clone + Send + 'static, additional_context: impl Fn() + Clone + Send + 'static,
method: routing::Method, method: leptos_router::Method,
mode: StaticMode, mode: StaticMode,
) -> axum::Router<S> ) -> axum::Router<S>
where where
@ -1449,11 +1449,11 @@ where
router.route( router.route(
path, path,
match method { match method {
routing::Method::Get => get(handler), leptos_router::Method::Get => get(handler),
routing::Method::Post => post(handler), leptos_router::Method::Post => post(handler),
routing::Method::Put => put(handler), leptos_router::Method::Put => put(handler),
routing::Method::Delete => delete(handler), leptos_router::Method::Delete => delete(handler),
routing::Method::Patch => patch(handler), leptos_router::Method::Patch => patch(handler),
}, },
) )
} }
@ -1492,11 +1492,11 @@ where
router.route( router.route(
path, path,
match method { match method {
routing::Method::Get => get(handler), leptos_router::Method::Get => get(handler),
routing::Method::Post => post(handler), leptos_router::Method::Post => post(handler),
routing::Method::Put => put(handler), leptos_router::Method::Put => put(handler),
routing::Method::Delete => delete(handler), leptos_router::Method::Delete => delete(handler),
routing::Method::Patch => patch(handler), leptos_router::Method::Patch => patch(handler),
}, },
) )
} }
@ -1645,11 +1645,11 @@ where
app_fn.clone(), app_fn.clone(),
); );
match method { match method {
routing::Method::Get => get(s), leptos_router::Method::Get => get(s),
routing::Method::Post => post(s), leptos_router::Method::Post => post(s),
routing::Method::Put => put(s), leptos_router::Method::Put => put(s),
routing::Method::Delete => delete(s), leptos_router::Method::Delete => delete(s),
routing::Method::Patch => patch(s), leptos_router::Method::Patch => patch(s),
} }
} }
SsrMode::PartiallyBlocked => { SsrMode::PartiallyBlocked => {
@ -1660,11 +1660,11 @@ where
true true
); );
match method { match method {
routing::Method::Get => get(s), leptos_router::Method::Get => get(s),
routing::Method::Post => post(s), leptos_router::Method::Post => post(s),
routing::Method::Put => put(s), leptos_router::Method::Put => put(s),
routing::Method::Delete => delete(s), leptos_router::Method::Delete => delete(s),
routing::Method::Patch => patch(s), leptos_router::Method::Patch => patch(s),
} }
} }
SsrMode::InOrder => { SsrMode::InOrder => {
@ -1674,11 +1674,11 @@ where
app_fn.clone(), app_fn.clone(),
); );
match method { match method {
routing::Method::Get => get(s), leptos_router::Method::Get => get(s),
routing::Method::Post => post(s), leptos_router::Method::Post => post(s),
routing::Method::Put => put(s), leptos_router::Method::Put => put(s),
routing::Method::Delete => delete(s), leptos_router::Method::Delete => delete(s),
routing::Method::Patch => patch(s), leptos_router::Method::Patch => patch(s),
} }
} }
SsrMode::Async => { SsrMode::Async => {
@ -1688,11 +1688,11 @@ where
app_fn.clone(), app_fn.clone(),
); );
match method { match method {
routing::Method::Get => get(s), leptos_router::Method::Get => get(s),
routing::Method::Post => post(s), leptos_router::Method::Post => post(s),
routing::Method::Put => put(s), leptos_router::Method::Put => put(s),
routing::Method::Delete => delete(s), leptos_router::Method::Delete => delete(s),
routing::Method::Patch => patch(s), leptos_router::Method::Patch => patch(s),
} }
} }
}, },
@ -1720,11 +1720,13 @@ where
router = router.route( router = router.route(
listing.path(), listing.path(),
match method { match method {
routing::Method::Get => get(handler.clone()), leptos_router::Method::Get => get(handler.clone()),
routing::Method::Post => post(handler.clone()), leptos_router::Method::Post => post(handler.clone()),
routing::Method::Put => put(handler.clone()), leptos_router::Method::Put => put(handler.clone()),
routing::Method::Delete => delete(handler.clone()), leptos_router::Method::Delete => {
routing::Method::Patch => patch(handler.clone()), delete(handler.clone())
}
leptos_router::Method::Patch => patch(handler.clone()),
}, },
); );
} }

View File

@ -4,7 +4,7 @@ use crate::{
renderer::DomRenderer, renderer::DomRenderer,
view::{add_attr::AddAnyAttr, Position, ToTemplate}, view::{add_attr::AddAnyAttr, Position, ToTemplate},
}; };
use std::{borrow::Cow, marker::PhantomData, rc::Rc, sync::Arc}; use std::{borrow::Cow, marker::PhantomData, sync::Arc};
#[inline(always)] #[inline(always)]
pub fn custom_attribute<K, V, R>(key: K, value: V) -> CustomAttr<K, V, R> pub fn custom_attribute<K, V, R>(key: K, value: V) -> CustomAttr<K, V, R>

View File

@ -3,7 +3,7 @@ use crate::{
html::{ html::{
attribute::*, attribute::*,
class::{class, Class, IntoClass}, class::{class, Class, IntoClass},
element::{ElementType, HasElementType}, element::HasElementType,
event::{on, on_target, EventDescriptor, On, Targeted}, event::{on, on_target, EventDescriptor, On, Targeted},
property::{property, IntoProperty, Property}, property::{property, IntoProperty, Property},
style::{style, IntoStyle, Style}, style::{style, IntoStyle, Style},

View File

@ -1,7 +1,6 @@
use crate::renderer::Renderer; use crate::renderer::Renderer;
use std::{ use std::{
borrow::Cow, borrow::Cow,
fmt::Write,
net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}, net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6},
num::{ num::{
NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8,

View File

@ -3,7 +3,7 @@ use crate::{
html::element::{CreateElement, ElementType, HtmlElement}, html::element::{CreateElement, ElementType, HtmlElement},
renderer::{dom::Dom, Renderer}, renderer::{dom::Dom, Renderer},
}; };
use std::{borrow::Cow, fmt::Debug, marker::PhantomData, rc::Rc, sync::Arc}; use std::{borrow::Cow, fmt::Debug, marker::PhantomData, sync::Arc};
// FIXME custom element HTML rendering is broken because tag names aren't static // FIXME custom element HTML rendering is broken because tag names aren't static
pub fn custom<E, Rndr>(tag: E) -> HtmlElement<Custom<E>, (), (), Rndr> pub fn custom<E, Rndr>(tag: E) -> HtmlElement<Custom<E>, (), (), Rndr>

View File

@ -4,7 +4,7 @@ use crate::{
renderer::{DomRenderer, Renderer}, renderer::{DomRenderer, Renderer},
view::add_attr::AddAnyAttr, view::add_attr::AddAnyAttr,
}; };
use std::{marker::PhantomData, rc::Rc, sync::Arc}; use std::{marker::PhantomData, sync::Arc};
#[inline(always)] #[inline(always)]
pub fn inner_html<T, R>(value: T) -> InnerHtml<T, R> pub fn inner_html<T, R>(value: T) -> InnerHtml<T, R>

View File

@ -12,12 +12,7 @@ use const_str_slice_concat::{
const_concat, const_concat_with_prefix, str_from_buffer, const_concat, const_concat_with_prefix, str_from_buffer,
}; };
use next_tuple::NextTuple; use next_tuple::NextTuple;
use std::{ use std::marker::PhantomData;
future::Future,
marker::PhantomData,
pin::Pin,
task::{Context, Poll},
};
mod custom; mod custom;
mod elements; mod elements;

View File

@ -2,10 +2,7 @@ use crate::{
renderer::Renderer, renderer::Renderer,
view::{Position, Render, RenderHtml}, view::{Position, Render, RenderHtml},
}; };
use std::{ use std::marker::PhantomData;
future::{ready, Ready},
marker::PhantomData,
};
pub mod attribute; pub mod attribute;
pub mod class; pub mod class;

View File

@ -6,7 +6,6 @@ use crate::{
view::{strings::StrState, Position, PositionState, ToTemplate}, view::{strings::StrState, Position, PositionState, ToTemplate},
}; };
use oco_ref::Oco; use oco_ref::Oco;
use std::future::{ready, Ready};
pub struct OcoStrState<R: Renderer> { pub struct OcoStrState<R: Renderer> {
node: R::Text, node: R::Text,

View File

@ -12,7 +12,6 @@ use crate::{
use reactive_graph::signal::guards::ReadGuard; use reactive_graph::signal::guards::ReadGuard;
use std::{ use std::{
fmt::Write, fmt::Write,
future::{ready, Ready},
net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}, net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6},
num::{ num::{
NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8,

View File

@ -1,5 +1,4 @@
use crate::{ use crate::{
async_views::Suspend,
html::attribute::{Attribute, AttributeValue}, html::attribute::{Attribute, AttributeValue},
hydration::Cursor, hydration::Cursor,
renderer::Renderer, renderer::Renderer,
@ -9,13 +8,7 @@ use crate::{
RenderHtml, ToTemplate, RenderHtml, ToTemplate,
}, },
}; };
use reactive_graph::{ use reactive_graph::effect::RenderEffect;
computed::ScopedFuture,
effect::RenderEffect,
graph::{Observer, ReactiveNode},
};
use std::future::{ready, Ready};
use throw_error::Error as AnyError;
mod class; mod class;
mod guards; mod guards;
@ -371,7 +364,7 @@ where
mod stable { mod stable {
use super::RenderEffectState; use super::RenderEffectState;
use crate::{ use crate::{
html::attribute::{Attribute, AttributeValue}, html::attribute::AttributeValue,
hydration::Cursor, hydration::Cursor,
renderer::Renderer, renderer::Renderer,
ssr::StreamBuilder, ssr::StreamBuilder,
@ -383,8 +376,6 @@ mod stable {
traits::Get, traits::Get,
wrappers::read::{ArcSignal, Signal}, wrappers::read::{ArcSignal, Signal},
}; };
use std::future::{ready, Ready};
use throw_error::Error as AnyError;
macro_rules! signal_impl { macro_rules! signal_impl {
($sig:ident) => { ($sig:ident) => {
@ -477,7 +468,7 @@ mod stable {
fn to_template(_key: &str, _buf: &mut String) {} fn to_template(_key: &str, _buf: &mut String) {}
fn hydrate<const FROM_SERVER: bool>( fn hydrate<const FROM_SERVER: bool>(
mut self, self,
key: &str, key: &str,
el: &<R as Renderer>::Element, el: &<R as Renderer>::Element,
) -> Self::State { ) -> Self::State {

View File

@ -45,7 +45,6 @@ where
(style.clone(), value) (style.clone(), value)
} }
}) })
.into()
} }
fn build(self, el: &R::Element) -> Self::State { fn build(self, el: &R::Element) -> Self::State {
@ -70,7 +69,6 @@ where
(style.clone(), value) (style.clone(), value)
} }
}) })
.into()
} }
fn rebuild(self, _state: &mut Self::State) { fn rebuild(self, _state: &mut Self::State) {

View File

@ -1,11 +1,9 @@
use super::{CastFrom, DomRenderer, Renderer}; use super::{CastFrom, DomRenderer, Renderer};
use crate::{ use crate::{
dom::{document, window}, dom::window,
ok_or_debug, or_debug,
view::{Mountable, ToTemplate}, view::{Mountable, ToTemplate},
}; };
use linear_map::LinearMap; use linear_map::LinearMap;
use once_cell::sync::Lazy;
use rustc_hash::FxHashSet; use rustc_hash::FxHashSet;
use sledgehammer_bindgen::bindgen; use sledgehammer_bindgen::bindgen;
use std::{ use std::{
@ -15,7 +13,6 @@ use std::{
rc::Rc, rc::Rc,
}; };
use wasm_bindgen::{ use wasm_bindgen::{
intern,
prelude::{wasm_bindgen, Closure}, prelude::{wasm_bindgen, Closure},
JsCast, JsValue, JsCast, JsValue,
}; };

View File

@ -3,7 +3,6 @@ use crate::{hydration::Cursor, renderer::Renderer, ssr::StreamBuilder};
use std::{ use std::{
any::{Any, TypeId}, any::{Any, TypeId},
fmt::Debug, fmt::Debug,
future::Ready,
marker::PhantomData, marker::PhantomData,
}; };

View File

@ -1,14 +1,6 @@
use super::{Mountable, Position, PositionState, Render, RenderHtml}; use super::{Mountable, Position, PositionState, Render, RenderHtml};
use crate::{ use crate::{hydration::Cursor, renderer::Renderer, ssr::StreamBuilder};
hydration::Cursor,
renderer::{CastFrom, Renderer},
ssr::StreamBuilder,
};
use either_of::*; use either_of::*;
use std::{
error::Error,
fmt::{Debug, Display},
};
pub struct EitherState<A, B, Rndr> pub struct EitherState<A, B, Rndr>
where where
@ -283,7 +275,7 @@ where
todo!() todo!()
} }
fn to_html_with_buf(self, buf: &mut String, position: &mut Position) { fn to_html_with_buf(self, _buf: &mut String, _position: &mut Position) {
todo!() todo!()
} }

View File

@ -1,17 +1,9 @@
use super::{Position, PositionState, RenderHtml}; use super::{Position, PositionState, RenderHtml};
use crate::{ use crate::{
hydration::Cursor, hydration::Cursor,
renderer::CastFrom,
ssr::StreamBuilder, ssr::StreamBuilder,
view::{Mountable, Render, Renderer}, view::{Mountable, Render, Renderer},
}; };
use pin_project_lite::pin_project;
use std::{
future::{Future, Ready},
marker::PhantomData,
pin::Pin,
task::{Context, Poll},
};
use throw_error::Error as AnyError; use throw_error::Error as AnyError;
impl<R, T, E> Render<R> for Result<T, E> impl<R, T, E> Render<R> for Result<T, E>

View File

@ -1,17 +1,6 @@
use super::{Mountable, Position, PositionState, Render, RenderHtml}; use super::{Mountable, Position, PositionState, Render, RenderHtml};
use crate::{ use crate::{hydration::Cursor, renderer::Renderer, ssr::StreamBuilder};
hydration::Cursor,
renderer::{CastFrom, Renderer},
ssr::StreamBuilder,
};
use futures::future::JoinAll;
use itertools::Itertools; use itertools::Itertools;
use pin_project_lite::pin_project;
use std::{
future::Future,
pin::Pin,
task::{Context, Poll},
};
impl<T, R> Render<R> for Option<T> impl<T, R> Render<R> for Option<T>
where where

View File

@ -8,7 +8,6 @@ use drain_filter_polyfill::VecExt as VecDrainFilterExt;
use indexmap::IndexSet; use indexmap::IndexSet;
use rustc_hash::FxHasher; use rustc_hash::FxHasher;
use std::{ use std::{
future::Future,
hash::{BuildHasherDefault, Hash}, hash::{BuildHasherDefault, Hash},
marker::PhantomData, marker::PhantomData,
}; };

View File

@ -6,7 +6,6 @@ use crate::{
}; };
use std::{ use std::{
fmt::Write, fmt::Write,
future::{ready, Ready},
net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}, net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6},
num::{ num::{
NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8,

View File

@ -6,10 +6,7 @@ use crate::{
hydration::Cursor, hydration::Cursor,
renderer::Renderer, renderer::Renderer,
}; };
use std::{ use std::marker::PhantomData;
future::{ready, Ready},
marker::PhantomData,
};
/// An attribute for which both the key and the value are known at compile time, /// An attribute for which both the key and the value are known at compile time,
/// i.e., as `&'static str`s. /// i.e., as `&'static str`s.

View File

@ -5,12 +5,7 @@ use crate::{
hydration::Cursor, hydration::Cursor,
renderer::{CastFrom, Renderer}, renderer::{CastFrom, Renderer},
}; };
use std::{ use std::{borrow::Cow, rc::Rc, sync::Arc};
borrow::Cow,
future::{ready, Ready},
rc::Rc,
sync::Arc,
};
pub struct StrState<'a, R: Renderer> { pub struct StrState<'a, R: Renderer> {
pub node: R::Text, pub node: R::Text,

View File

@ -10,12 +10,6 @@ use crate::{
use const_str_slice_concat::{ use const_str_slice_concat::{
const_concat, const_concat_with_separator, str_from_buffer, const_concat, const_concat_with_separator, str_from_buffer,
}; };
use pin_project_lite::pin_project;
use std::{
future::{ready, Future, Ready},
pin::Pin,
task::{Context, Poll},
};
impl<R: Renderer> Render<R> for () { impl<R: Renderer> Render<R> for () {
type State = (); type State = ();