Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint warnings #784

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/sycamore-futures/src/suspense.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl SuspenseScope {
|| self
.parent
.as_ref()
.map_or(false, |parent| parent.get()._is_loading())
.is_some_and(|parent| parent.get()._is_loading())
}

/// Returns a signal representing whether we are currently loading this suspense or not.
Expand Down Expand Up @@ -153,6 +153,7 @@ pub fn create_detached_suspense_scope<T>(f: impl FnOnce() -> T) -> (T, SuspenseS
}

// TODO: remove this in the next major version
#[allow(missing_docs)]
#[deprecated = "Please use `create_detached_suspense_scope` instead"]
pub fn create_detatched_suspense_scope<T>(f: impl FnOnce() -> T) -> (T, SuspenseScope) {
create_detached_suspense_scope(f)
Expand Down
2 changes: 1 addition & 1 deletion packages/sycamore-macro/src/props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ mod field_info {
pub builder_attr: FieldBuilderAttr,
}

impl<'a> FieldInfo<'a> {
impl FieldInfo<'_> {
pub fn new(
ordinal: usize,
field: &syn::Field,
Expand Down
1 change: 0 additions & 1 deletion packages/sycamore-router/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pub trait Integration {
fn on_popstate(&self, f: Box<dyn FnMut()>);

/// Get the click handler that is run when links are clicked.

fn click_handler(&self) -> Box<dyn Fn(web_sys::MouseEvent)>;
}

Expand Down
7 changes: 4 additions & 3 deletions packages/sycamore-view-parser/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,10 @@ fn is_dyn_pattern(pat: &Pat) -> bool {
fn is_dyn_macro(m: &syn::Macro) -> bool {
// Bodies of nested inner view! macros will be checked for dynamic
// parts when their own codegen is run.
!m.path
.get_ident()
.is_some_and(|ident| "view" == &ident.to_string())

// TODO(MSRV >= 1.82): use `is_none_or` and remove the `allow(clippy::nonminimal_bool)`
#[allow(clippy::nonminimal_bool)]
!m.path.get_ident().is_some_and(|ident| ident == "view")
}

fn is_dyn_block(block: &syn::Block) -> bool {
Expand Down
6 changes: 3 additions & 3 deletions packages/sycamore-web/src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,15 @@ impl<'a> HashableNode<'a> {
}
}

impl<'a> PartialEq for HashableNode<'a> {
impl PartialEq for HashableNode<'_> {
fn eq(&self, other: &Self) -> bool {
self.1 == other.1
}
}

impl<'a> Eq for HashableNode<'a> {}
impl Eq for HashableNode<'_> {}

impl<'a> Hash for HashableNode<'a> {
impl Hash for HashableNode<'_> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.1.hash(state);
}
Expand Down
Loading