From 0a98a06ef74ae6e5766b16a123c117888eb39dbc Mon Sep 17 00:00:00 2001 From: Pascal Scholz Date: Thu, 9 Jul 2026 09:32:24 +0200 Subject: [PATCH] option_parser: Make error messages adhere to coding style The coding style in `CONTRIBUTING.md` under `Coding Style & Code Comments` states that `thiserror` error messages should start with a capital letter. Signed-off-by: Pascal Scholz On-behalf-of: SAP pascal.scholz@sap.com --- option_parser/src/lib.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/option_parser/src/lib.rs b/option_parser/src/lib.rs index 6ab3314a7..12dbe1719 100644 --- a/option_parser/src/lib.rs +++ b/option_parser/src/lib.rs @@ -71,16 +71,16 @@ struct OptionParserValue { #[derive(Debug, Error)] pub enum OptionParserError { /// An option name was not previously registered with [`OptionParser::add`]. - #[error("unknown option: {0}")] + #[error("Unknown option: {0}")] UnknownOption(String), /// The input string has invalid syntax (unbalanced quotes/brackets, missing `=`). - #[error("invalid syntax: {0}")] + #[error("Invalid syntax: {0}")] InvalidSyntax(String), /// A value could not be converted to the requested type. - #[error("unable to convert {1} for {0}")] + #[error("Unable to convert {1} for {0}")] Conversion(String /* field */, String /* value */), /// A value was syntactically valid but semantically wrong. - #[error("invalid value: {0}")] + #[error("Invalid value: {0}")] InvalidValue(String), } type OptionParserResult = result::Result; @@ -296,7 +296,7 @@ pub struct Toggle(pub bool); #[derive(Error, Debug)] pub enum ToggleParseError { - #[error("invalid value: {0}")] + #[error("Invalid value: {0}")] InvalidValue(String), } @@ -323,7 +323,7 @@ pub struct ByteSized(pub u64); #[derive(Error, Debug)] pub enum ByteSizedParseError { - #[error("invalid value: {0}")] + #[error("Invalid value: {0}")] InvalidValue(String), } @@ -375,7 +375,7 @@ impl Display for IntegerList { #[derive(Error, Debug)] pub enum IntegerListParseError { - #[error("invalid value: {0}")] + #[error("Invalid value: {0}")] InvalidValue(String), } @@ -466,15 +466,15 @@ impl TupleValue for Vec { #[derive(Error, Debug)] pub enum TupleError { - #[error("invalid value: {0}")] + #[error("Invalid value: {0}")] InvalidValue(String), #[error("Unbalanced brackets in one of the values")] SplitInsideBrackets(#[source] OptionParserError), #[error("Expected a single pair of enclosing brackets in input: {0}")] UnbalancedOutsideBrackets(String), - #[error("invalid integer list")] + #[error("Invalid integer list")] InvalidIntegerList(#[source] IntegerListParseError), - #[error("invalid integer")] + #[error("Invalid integer")] InvalidInteger(#[source] ParseIntError), } @@ -545,7 +545,7 @@ pub struct StringList(pub Vec); #[derive(Error, Debug)] pub enum StringListParseError { - #[error("invalid value: {0}")] + #[error("Invalid value: {0}")] InvalidValue(String), }