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

View file

@ -4,7 +4,7 @@ use crate::{
renderer::DomRenderer,
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)]
pub fn custom_attribute<K, V, R>(key: K, value: V) -> CustomAttr<K, V, R>

View file

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

View file

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

View file

@ -3,7 +3,7 @@ use crate::{
html::element::{CreateElement, ElementType, HtmlElement},
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
pub fn custom<E, Rndr>(tag: E) -> HtmlElement<Custom<E>, (), (), Rndr>

View file

@ -4,7 +4,7 @@ use crate::{
renderer::{DomRenderer, Renderer},
view::add_attr::AddAnyAttr,
};
use std::{marker::PhantomData, rc::Rc, sync::Arc};
use std::{marker::PhantomData, sync::Arc};
#[inline(always)]
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,
};
use next_tuple::NextTuple;
use std::{
future::Future,
marker::PhantomData,
pin::Pin,
task::{Context, Poll},
};
use std::marker::PhantomData;
mod custom;
mod elements;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,14 +1,6 @@
use super::{Mountable, Position, PositionState, Render, RenderHtml};
use crate::{
hydration::Cursor,
renderer::{CastFrom, Renderer},
ssr::StreamBuilder,
};
use crate::{hydration::Cursor, renderer::Renderer, ssr::StreamBuilder};
use either_of::*;
use std::{
error::Error,
fmt::{Debug, Display},
};
pub struct EitherState<A, B, Rndr>
where
@ -283,7 +275,7 @@ where
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!()
}

View file

@ -1,17 +1,9 @@
use super::{Position, PositionState, RenderHtml};
use crate::{
hydration::Cursor,
renderer::CastFrom,
ssr::StreamBuilder,
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;
impl<R, T, E> Render<R> for Result<T, E>

View file

@ -1,17 +1,6 @@
use super::{Mountable, Position, PositionState, Render, RenderHtml};
use crate::{
hydration::Cursor,
renderer::{CastFrom, Renderer},
ssr::StreamBuilder,
};
use futures::future::JoinAll;
use crate::{hydration::Cursor, renderer::Renderer, ssr::StreamBuilder};
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>
where

View file

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

View file

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

View file

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

View file

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

View file

@ -10,12 +10,6 @@ use crate::{
use const_str_slice_concat::{
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 () {
type State = ();