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.
Loading
Please register or sign in to comment