Struct line_wrap::SliceLineEnding
source · pub struct SliceLineEnding<'a> { /* private fields */ }
Expand description
A byte slice line ending.
Gives up some throughput compared to the specialized single/double byte impls, but works with any length.
Examples
use line_wrap::*;
let ending = SliceLineEnding::new(b"xyz");
let mut data = vec![1, 2, 3, 4, 5, 6, 255, 255, 255, 255, 255, 255];
assert_eq!(6, line_wrap(&mut data[..], 6, 2, &ending));
assert_eq!(vec![1, 2, b'x', b'y', b'z', 3, 4, b'x', b'y', b'z', 5, 6], data);