Skip to content

Commit

Permalink
fix doc, fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cre4ture committed Jan 12, 2024
1 parent 72334c1 commit 299decf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/uu/env/src/split_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
//! Even though it looks quite like a POSIX syntax, the original
//! "shell_words" implementation had to be adapted significantly.
//!
//! Apart from the grammar differences, there is a new feature integrated: $VARIABLE expansion by subst crate.
//! Apart from the grammar differences, there is a new feature integrated: $VARIABLE expansion.
//!
//! [GNU env] https://www.gnu.org/software/coreutils/manual/html_node/env-invocation.html#g_t_002dS_002f_002d_002dsplit_002dstring-syntax
//! [GNU env] <https://www.gnu.org/software/coreutils/manual/html_node/env-invocation.html#g_t_002dS_002f_002d_002dsplit_002dstring-syntax>
#![forbid(unsafe_code)]

Expand Down Expand Up @@ -196,7 +196,8 @@ impl<'a> SplitIterator<'a> {
if pos_end == pos_start {
return Err(ParseError::ParsingOfVariableNameFailed {
pos: pos_start,
msg: "Missing variable name".into() });
msg: "Missing variable name".into(),
});
}

Ok(self.raw_parser.get_substring(&Range {
Expand Down
8 changes: 5 additions & 3 deletions tests/by-util/test_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,10 @@ mod tests_split_iterator {
);
assert_eq!(
split(r#""$""#),
Err(ParseError::ParsingOfVariableNameFailed { pos: 2, msg: "Missing variable name".into() }),
Err(ParseError::ParsingOfVariableNameFailed {
pos: 2,
msg: "Missing variable name".into()
}),
);
}

Expand Down Expand Up @@ -932,8 +935,7 @@ mod test_raw_string_parser {
}

#[test]
fn test_multi_byte_codes_skip_one_take_one_skip_until_ascii_char_or_end()
{
fn test_multi_byte_codes_skip_one_take_one_skip_until_ascii_char_or_end() {
let input = "🦉🦉🦉x🦉🦉x🦉x🦉🦉🦉🦉";
let mut uut = env::raw_string_parser::RawStringParser::new(input);

Expand Down

0 comments on commit 299decf

Please sign in to comment.