Skip to content
Snippets Groups Projects
Commit 20c102ed authored by Simon Tatham's avatar Simon Tatham
Browse files

Make Clippy happy.

It's started complaining about assignments 'foo = bar.clone()' or
'foo = bar.to_owned()', preferring 'foo.clone_from(bar)' and
'bar.clone_into(foo)' respectively. Makes sense in general, because
you can imagine the target object e.g. already having an allocated
subthing which it can reuse rather than freeing it and making a new
one. Not sure about the aesthetics in the case of
"some string literal".clone_into(&mut some_String), but I suppose the
'reuse existing buffer' argument still has some validity.

Clippy wanted to modify scroll_to_selection() less intrusively, so
that it just turned the None clause of the match from 'return'
into (). But having done that it seemed better to make the whole thing
an if let, saving an indent level.
parent 34ef0bb8
No related branches found
No related tags found
Loading
Pipeline #734986 passed with stages
in 9 minutes and 46 seconds
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment