Skip to content

Commit dc6e8fb

Browse files
authored
Fix cargo
1 parent 463f5e2 commit dc6e8fb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/side_diff.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn push_output(
3535
Ok(())
3636
}
3737

38-
pub fn diff(from_file: &Vec<u8>, to_file: &Vec<u8>) -> Vec<u8> {
38+
pub fn diff(from_file: &[u8], to_file: &[u8]) -> Vec<u8> {
3939
// ^ The left file ^ The right file
4040

4141
let mut output = stdout().lock();
@@ -47,7 +47,7 @@ pub fn diff(from_file: &Vec<u8>, to_file: &Vec<u8>) -> Vec<u8> {
4747
Result::Left(left_ln) => {
4848
push_output(
4949
&mut output,
50-
&limited_string(left_ln, tab_size),
50+
limited_string(left_ln, tab_size),
5151
&[],
5252
b"<",
5353
tab_size,
@@ -58,7 +58,7 @@ pub fn diff(from_file: &Vec<u8>, to_file: &Vec<u8>) -> Vec<u8> {
5858
push_output(
5959
&mut output,
6060
&[],
61-
&limited_string(right_ln, tab_size),
61+
limited_string(right_ln, tab_size),
6262
b">",
6363
tab_size,
6464
)
@@ -67,8 +67,8 @@ pub fn diff(from_file: &Vec<u8>, to_file: &Vec<u8>) -> Vec<u8> {
6767
Result::Both(left_ln, right_ln) => {
6868
push_output(
6969
&mut output,
70-
&limited_string(left_ln, tab_size),
71-
&limited_string(right_ln, tab_size),
70+
limited_string(left_ln, tab_size),
71+
limited_string(right_ln, tab_size),
7272
b" ",
7373
tab_size,
7474
)

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub fn report_failure_to_read_input_file(
101101
/// Limits a string at a certain limiter position. This can break the
102102
/// encoding of a specific char where it has been cut.
103103
#[must_use]
104-
pub fn limited_string<'a>(orig: &'a [u8], limiter: usize) -> &'a [u8] {
104+
pub fn limited_string(orig: &[u8], limiter: usize) -> &[u8] {
105105
// TODO: Verify if we broke the enconding of the char
106106
// when we cut it.
107107
&orig[..orig.len().min(limiter)]

0 commit comments

Comments
 (0)