equal
deleted
inserted
replaced
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 { |