Skip to content

Commit a2e2bb3

Browse files
committed
fix: clippy warnings
- Allow incompatible_msrv for PanicInfo type (stable since 1.81.0) - Allow dead_code for test struct Comp - Remove unnecessary parentheses in closure
1 parent 99305cf commit a2e2bb3

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

examples/communication_grandchild_with_grandparent/src/child.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl Component for Child {
4545
let name = format!("I'm {my_name}.");
4646

4747
// Here we emit the callback to the grandparent component, whenever the button is clicked.
48-
let onclick = self.state.child_clicked.reform(move |_| (my_name.clone()));
48+
let onclick = self.state.child_clicked.reform(move |_| my_name.clone());
4949

5050
html! {
5151
<div class="child-body">

packages/yew-macro/src/html_tree/html_element.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,15 +457,17 @@ impl ToTokens for HtmlElement {
457457
#[rustversion::since(1.88)]
458458
fn derive_debug_tag(vtag: &Ident) -> String {
459459
let span = vtag.span().unwrap();
460-
#[allow(clippy::incompatible_msrv, reason="the file, line, column methods are stable since 1.88")]
460+
#[allow(clippy::incompatible_msrv)]
461461
{
462+
// the file, line, column methods are stable since 1.88
462463
format!("[{}:{}:{}] ", span.file(), span.line(), span.column())
463464
}
464465
}
465466
#[rustversion::before(1.88)]
466467
fn derive_debug_tag(_: &Ident) -> &'static str {
467468
""
468469
}
470+
469471
let invalid_void_tag_msg_start = derive_debug_tag(&vtag);
470472

471473
let value = value();

packages/yew/src/renderer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ thread_local! {
1818
/// Unless a panic hook is set through this function, Yew will
1919
/// overwrite any existing panic hook when an application is rendered with [Renderer].
2020
#[cfg(feature = "csr")]
21+
#[allow(clippy::incompatible_msrv)]
2122
pub fn set_custom_panic_hook(hook: Box<dyn Fn(&PanicInfo<'_>) + Sync + Send + 'static>) {
2223
std::panic::set_hook(hook);
2324
PANIC_HOOK_IS_SET.with(|hook_is_set| hook_is_set.set(true));

packages/yew/src/tests/layout_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use crate::html::AnyScope;
88
use crate::virtual_dom::VNode;
99
use crate::{scheduler, Component, Context, Html};
1010

11+
#[allow(dead_code)]
1112
struct Comp;
1213
impl Component for Comp {
1314
type Message = ();

0 commit comments

Comments
 (0)