Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
cre4ture committed Feb 18, 2024
1 parent a0726de commit 7555295
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/uu/env/src/split_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ impl<'a> SplitIterator<'a> {
return Ok(());
}
Some(_) => {
self.get_parser_mut().skip_until_ascii_char_or_end('\n');
self.get_parser_mut().skip_until_char_or_end('\n');
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/uu/env/src/string_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl<'a> StringParser<'a> {
self.set_pointer(end_ptr);
}

pub fn skip_until_ascii_char_or_end(&mut self, c: char) {
pub fn skip_until_char_or_end(&mut self, c: char) {
let pos = self.pointer_str.find(c);

if let Some(pos) = pos {
Expand Down
10 changes: 5 additions & 5 deletions tests/by-util/test_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1018,10 +1018,10 @@ mod test_raw_string_parser {

uut.skip_one().unwrap(); // skip x
assert_eq!(uut.get_look_at_pos(), 22);
uut.get_parser_mut().skip_until_ascii_char_or_end('x'); // skip πŸ¦‰
uut.get_parser_mut().skip_until_char_or_end('x'); // skip πŸ¦‰
assert_eq!(uut.get_look_at_pos(), 26);
uut.take_one().unwrap(); // take x
uut.get_parser_mut().skip_until_ascii_char_or_end('x'); // skip πŸ¦‰πŸ¦‰πŸ¦‰πŸ¦‰ till end
uut.get_parser_mut().skip_until_char_or_end('x'); // skip πŸ¦‰πŸ¦‰πŸ¦‰πŸ¦‰ till end
assert_eq!(uut.get_look_at_pos(), 43);

uut.take_one().unwrap_err();
Expand Down Expand Up @@ -1061,7 +1061,7 @@ mod test_raw_string_parser {
uut.take_one().unwrap(); // takes πŸ¦‰πŸ¦‰πŸ¦‰
uut.put_string("ooπŸ¦”");
uut.take_one().unwrap(); // take x
uut.get_parser_mut().skip_until_ascii_char_or_end('\n'); // skips till end
uut.get_parser_mut().skip_until_char_or_end('\n'); // skips till end
uut.put_string("oπŸ¦”o");

uut.take_one().unwrap_err();
Expand All @@ -1079,7 +1079,7 @@ mod test_raw_string_parser {
uut.get_parser().look_at_remaining(),
OsStr::new(&input[12..])
);
uut.get_parser_mut().skip_until_ascii_char_or_end('\n'); // skips till end
uut.get_parser_mut().skip_until_char_or_end('\n'); // skips till end
assert_eq!(uut.get_parser().look_at_remaining(), "");

uut.take_one().unwrap_err();
Expand Down Expand Up @@ -1107,7 +1107,7 @@ mod test_raw_string_parser {
OsStr::new(&input_str.as_os_str().split_at(2).1)
);
assert_eq!(uut.get_parser().look_at().unwrap(), '>');
uut.get_parser_mut().skip_until_ascii_char_or_end('\n');
uut.get_parser_mut().skip_until_char_or_end('\n');
assert_eq!(uut.get_parser().look_at_remaining(), "");

uut.take_one().unwrap_err();
Expand Down

0 comments on commit 7555295

Please sign in to comment.