diff options
| author | Austin Hellyer <[email protected]> | 2017-01-08 08:45:17 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2017-01-08 08:45:17 -0800 |
| commit | a658105f7499efe994280906e85fd51c2b70c3a7 (patch) | |
| tree | 4c8af6a353b9fece3f5a9d9a9e7a90f25d53cc79 /src/model/misc.rs | |
| parent | Wait 5s between shard boots (diff) | |
| download | serenity-a658105f7499efe994280906e85fd51c2b70c3a7.tar.xz serenity-a658105f7499efe994280906e85fd51c2b70c3a7.zip | |
Code style cleanup
Diffstat (limited to 'src/model/misc.rs')
| -rw-r--r-- | src/model/misc.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/model/misc.rs b/src/model/misc.rs index 5d9017d..f3632a5 100644 --- a/src/model/misc.rs +++ b/src/model/misc.rs @@ -81,6 +81,7 @@ impl Mentionable for User { #[cfg(all(feature="cache", feature="methods"))] impl FromStr for User { type Err = (); + fn from_str(s: &str) -> StdResult<Self, ()> { match utils::parse_username(s) { Some(x) => { @@ -96,6 +97,7 @@ impl FromStr for User { impl FromStr for UserId { type Err = (); + fn from_str(s: &str) -> StdResult<Self, ()> { utils::parse_username(s).ok_or_else(|| ()).map(UserId) } @@ -104,6 +106,7 @@ impl FromStr for UserId { #[cfg(all(feature="cache", feature="methods"))] impl FromStr for Role { type Err = (); + fn from_str(s: &str) -> StdResult<Self, ()> { match utils::parse_role(s) { Some(x) => { @@ -119,6 +122,7 @@ impl FromStr for Role { impl FromStr for RoleId { type Err = (); + fn from_str(s: &str) -> StdResult<Self, ()> { utils::parse_role(s).ok_or_else(|| ()).map(RoleId) } @@ -135,6 +139,7 @@ impl EmojiIdentifier { impl FromStr for EmojiIdentifier { type Err = (); + fn from_str(s: &str) -> StdResult<Self, ()> { utils::parse_emoji(s).ok_or_else(|| ()) } @@ -142,6 +147,7 @@ impl FromStr for EmojiIdentifier { impl FromStr for ChannelId { type Err = (); + fn from_str(s: &str) -> StdResult<Self, ()> { utils::parse_channel(s).ok_or_else(|| ()).map(ChannelId) } @@ -150,6 +156,7 @@ impl FromStr for ChannelId { #[cfg(all(feature="cache", feature="methods"))] impl FromStr for Channel { type Err = (); + fn from_str(s: &str) -> StdResult<Self, ()> { match utils::parse_channel(s) { Some(x) => { |