From 696458657b26032e6e2a987c059fd69aaa10508d Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 19 Sep 2022 17:08:01 +0300 Subject: kittybox-indieauth: Allow converting more types to/from strings Sometimes it is needed, for example, to construct an HTML form pre-filled with the request data. --- kittybox-rs/indieauth/src/scopes.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kittybox-rs/indieauth/src/scopes.rs') diff --git a/kittybox-rs/indieauth/src/scopes.rs b/kittybox-rs/indieauth/src/scopes.rs index ae039a6..d74878e 100644 --- a/kittybox-rs/indieauth/src/scopes.rs +++ b/kittybox-rs/indieauth/src/scopes.rs @@ -83,6 +83,12 @@ impl From<&str> for Scope { } } } +impl FromStr for Scope { + type Err = std::convert::Infallible; + fn from_str(s: &str) -> Result { + Ok(s.into()) + } +} /// A list of scopes that serializes to a space-separated string instead of a list. /// -- cgit 1.4.1