From 931b6338f1258a12df29bfc8dbb3c5e839295258 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 26 Sep 2022 09:18:39 -0500 Subject: [PATCH] refactor(parser): Clarify FromStr from future FromStr --- src/builder/value_parser.rs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/builder/value_parser.rs b/src/builder/value_parser.rs index 3f61433b..cfbfc238 100644 --- a/src/builder/value_parser.rs +++ b/src/builder/value_parser.rs @@ -2105,18 +2105,17 @@ pub mod via_prelude { } #[doc(hidden)] - pub trait _ValueParserViaFromStr: private::_ValueParserViaFromStrSealed { + pub trait _ValueParserViaParse: private::_ValueParserViaParseSealed { fn value_parser(&self) -> _AnonymousValueParser; } - impl _ValueParserViaFromStr for _AutoValueParser + impl _ValueParserViaParse for _AutoValueParser where - FromStr: std::str::FromStr + std::any::Any + Clone + Send + Sync + 'static, - ::Err: - Into>, + Parse: std::str::FromStr + std::any::Any + Clone + Send + Sync + 'static, + ::Err: Into>, { fn value_parser(&self) -> _AnonymousValueParser { - let func: fn(&str) -> Result::Err> = - FromStr::from_str; + let func: fn(&str) -> Result::Err> = + Parse::from_str; _AnonymousValueParser(ValueParser::new(func)) } } @@ -2226,12 +2225,11 @@ mod private { { } - pub trait _ValueParserViaFromStrSealed {} - impl _ValueParserViaFromStrSealed for _AutoValueParser + pub trait _ValueParserViaParseSealed {} + impl _ValueParserViaParseSealed for _AutoValueParser where - FromStr: std::str::FromStr + std::any::Any + Send + Sync + 'static, - ::Err: - Into>, + Parse: std::str::FromStr + std::any::Any + Send + Sync + 'static, + ::Err: Into>, { } }