Skip to content

Commit

Permalink
to reprodce this clippy warning
Browse files Browse the repository at this point in the history
```bash
cd leptos/leptos_macro/example
cargo clippy
```

warning: the following explicit lifetimes could be elided: 'a
  --> src/lib.rs:41:20
   |
41 | fn TestMutCallback<'a, F>(mut callback: F, value: &'a str) -> impl IntoView
   |                    ^^                              ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
   = note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
   |
41 - fn TestMutCallback<'a, F>(mut callback: F, value: &'a str) -> impl IntoView
41 + fn TestMutCallback<F>(mut callback: F, value: &str) -> impl IntoView
   |

warning: `example` (lib) generated 1 warning (run `cargo clippy --fix --lib -p example` to apply 1 suggestion)
  • Loading branch information
martinfrances107 committed Dec 20, 2023
1 parent 21f4c27 commit 3f77139
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion leptos_macro/example/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn TestComponent(
}

#[component]
fn TestMutCallback<'a, F>(mut callback: F, value: &'a str) -> impl IntoView
fn TestMutCallback<F>(mut callback: F, value: &'static str) -> impl IntoView
where
F: FnMut(u32) + 'static,
{
Expand Down

0 comments on commit 3f77139

Please sign in to comment.