Mercurial > public > mercurial-scm > hg-stable
comparison rust/hg-core/src/utils.rs @ 42851:ce6797ef6eab
rust: apply more formatting fixes
My cargo fmt updated these lines and they look good.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 31 Aug 2019 14:12:38 +0900 |
parents | 5399532510ae |
children | 62eabdf91f85 |
comparison
equal
deleted
inserted
replaced
42850:b1b984f9c01d | 42851:ce6797ef6eab |
---|---|
18 /// let mut line = b"I hate writing tests!".to_vec(); | 18 /// let mut line = b"I hate writing tests!".to_vec(); |
19 /// replace_slice(&mut line, b"hate", b"love"); | 19 /// replace_slice(&mut line, b"hate", b"love"); |
20 /// assert_eq!( | 20 /// assert_eq!( |
21 /// line, | 21 /// line, |
22 /// b"I love writing tests!".to_vec() | 22 /// b"I love writing tests!".to_vec() |
23 ///); | 23 /// ); |
24 /// | |
25 /// ``` | 24 /// ``` |
26 pub fn replace_slice<T>(buf: &mut [T], from: &[T], to: &[T]) | 25 pub fn replace_slice<T>(buf: &mut [T], from: &[T], to: &[T]) |
27 where | 26 where |
28 T: Clone + PartialEq, | 27 T: Clone + PartialEq, |
29 { | 28 { |