Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions src/uu/dd/src/parseargs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,6 @@ impl Parser {
Self::default()
}

/// Parse the operands, keeping only the error itself.
///
/// The utility itself goes through [`Self::parse_with_diagnostics`], which
/// also knows which operand failed; this is the plain form the unit tests
/// compare against.
#[cfg(test)]
pub(crate) fn parse(
self,
operands: impl IntoIterator<Item: AsRef<str>>,
) -> Result<Settings, ParseError> {
self.read(operands).map_err(|(_, error)| error)?.validate()
}

/// Parse the operands, pointing a caret at the one that is at fault.
///
/// # Arguments
Expand Down
13 changes: 13 additions & 0 deletions src/uu/dd/src/parseargs/unit_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ use crate::conversion_tables::{
};
use crate::parseargs::Parser;

impl Parser {
/// Parse the operands, keeping only the error itself.
///
/// The utility goes through `parse_with_diagnostics`, which also knows
/// which operand failed; this is the plain form the tests compare against.
pub(crate) fn parse(
self,
operands: impl IntoIterator<Item: AsRef<str>>,
) -> Result<Settings, ParseError> {
self.read(operands).map_err(|(_, error)| error)?.validate()
}
}

#[cfg(not(any(target_os = "linux", target_os = "android")))]
#[allow(clippy::useless_vec)]
#[test]
Expand Down
Loading