diff --git a/src/uu/dd/src/parseargs.rs b/src/uu/dd/src/parseargs.rs index cf123f250cf..8acf1830ddc 100644 --- a/src/uu/dd/src/parseargs.rs +++ b/src/uu/dd/src/parseargs.rs @@ -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>, - ) -> Result { - self.read(operands).map_err(|(_, error)| error)?.validate() - } - /// Parse the operands, pointing a caret at the one that is at fault. /// /// # Arguments diff --git a/src/uu/dd/src/parseargs/unit_tests.rs b/src/uu/dd/src/parseargs/unit_tests.rs index cde0ef0cc1f..9e5c9871b10 100644 --- a/src/uu/dd/src/parseargs/unit_tests.rs +++ b/src/uu/dd/src/parseargs/unit_tests.rs @@ -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>, + ) -> Result { + self.read(operands).map_err(|(_, error)| error)?.validate() + } +} + #[cfg(not(any(target_os = "linux", target_os = "android")))] #[allow(clippy::useless_vec)] #[test]