Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Warning: unnecessary lifetime parameter 'a #14351

Closed
abhi3700 opened this issue Jun 12, 2023 · 3 comments
Closed

Warning: unnecessary lifetime parameter 'a #14351

abhi3700 opened this issue Jun 12, 2023 · 3 comments
Labels
I7-refactor Code needs refactoring.

Comments

@abhi3700
Copy link
Contributor

abhi3700 commented Jun 12, 2023

pub struct PiecewiseLinear<'a> {

gives this error:

❯ cargo build -r
warning: unnecessary lifetime parameter `'a`
  --> primitives/runtime/src/curve.rs:29:28
   |
29 | pub struct PiecewiseLinear<'a> {
   |                            ^^
   |
   = help: you can use the `'static` lifetime directly, in place of `'a`

warning: `sp-runtime` (lib) generated 1 warning

Tasks

No tasks being tracked yet.
@ggwpez
Copy link
Member

ggwpez commented Jun 12, 2023

Yep please go ahead.
There could be more of these cases - depending on your version of Clippy.

@ggwpez ggwpez added the I7-refactor Code needs refactoring. label Jun 12, 2023
@bkchr
Copy link
Member

bkchr commented Jun 12, 2023

This code is correct, you need to upgrade your rustc.

See: #14096

@bkchr bkchr closed this as completed Jun 12, 2023
@abhi3700
Copy link
Contributor Author

Thanks! I updated & no such warning now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I7-refactor Code needs refactoring.
Projects
None yet
Development

No branches or pull requests

3 participants