diff options
author | Vika <vika@fireburn.ru> | 2022-09-19 17:08:01 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2022-09-19 17:08:01 +0300 |
commit | 696458657b26032e6e2a987c059fd69aaa10508d (patch) | |
tree | 57caa3e69a32756f1f5c075782a1abb3e4587d07 /kittybox-rs/indieauth/src/scopes.rs | |
parent | 629531bdefad41e8839fa818e68bcf9a083466f8 (diff) | |
download | kittybox-696458657b26032e6e2a987c059fd69aaa10508d.tar.zst |
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.
Diffstat (limited to 'kittybox-rs/indieauth/src/scopes.rs')
-rw-r--r-- | kittybox-rs/indieauth/src/scopes.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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<Self, Self::Err> { + Ok(s.into()) + } +} /// A list of scopes that serializes to a space-separated string instead of a list. /// |