Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve branches_sharing_code clippy lint
warning: all if blocks contain the same code at the start --> src/error.rs:744:5 | 744 | / if TypeId::of::<C>() == target { 745 | | let unerased = e.cast::<ErrorImpl<ContextError<C, Error>>>().deref(); | |_____________________________________________________________________________^ | = note: `#[warn(clippy::branches_sharing_code)]` on by default = warning: Some moved values might need to be renamed to avoid wrong references = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code help: consider moving the start statements out like this | 744 | let unerased = e.cast::<ErrorImpl<ContextError<C, Error>>>().deref(); 745 | if TypeId::of::<C>() == target { | warning: all if blocks contain the same code at the start --> src/error.rs:761:5 | 761 | / if TypeId::of::<C>() == target { 762 | | let unerased = e.cast::<ErrorImpl<ContextError<C, Error>>>().deref_mut(); | |_________________________________________________________________________________^ | = warning: Some moved values might need to be renamed to avoid wrong references = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code help: consider moving the start statements out like this | 761 | let unerased = e.cast::<ErrorImpl<ContextError<C, Error>>>().deref_mut(); 762 | if TypeId::of::<C>() == target { |
- Loading branch information