diff --git a/typed/src/errors/error.rs b/typed/src/errors/error.rs index 7e8f8c6aaa..67552ee2d6 100644 --- a/typed/src/errors/error.rs +++ b/typed/src/errors/error.rs @@ -95,9 +95,7 @@ impl Error { fn underline(mut start: usize, mut end: usize) -> String { if start > end { - let tmp = start; - start = end; - end = tmp; + std::mem::swap(&mut start, &mut end) } let mut underline = String::new();