I started using pest-ast and I was running into the following lint:
warning: using `clone` on type `Span<'_>` which implements the `Copy` trait
--> src/ast.rs:102:38
|
102 | ...t_ast(outer(with(span_into_string)))] String);
| ^^^^^ help: try removing the `clone` call: `outer`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
Personally I think it is desirable to have it on, so I checked out pest-ast's code and noticed that the first element in the ConversionStrategy::Outer tuple is always a Span, which is Copy and thus shouldn't ever need clone.
I have not delved super deep in the code, though, so I'm not 100% confident on this statement: have I overlooked something?
I also changed the example slightly, removing the need for allowing lints altogether. Hth!
Hi!
I started using
pest-ast
and I was running into the following lint:Personally I think it is desirable to have it on, so I checked out
pest-ast
's code and noticed that the first element in theConversionStrategy::Outer
tuple is always aSpan
, which isCopy
and thus shouldn't ever needclone
.I have not delved super deep in the code, though, so I'm not 100% confident on this statement: have I overlooked something?
I also changed the example slightly, removing the need for allowing lints altogether. Hth!