diff options
| author | Lakelezz <[email protected]> | 2018-12-18 20:55:32 +0100 |
|---|---|---|
| committer | Alex M. M <[email protected]> | 2018-12-18 20:55:32 +0100 |
| commit | 8cb1bdc6cf992cc55810f5af753666d54f2237d5 (patch) | |
| tree | 052e2f425a6117e45323886bb2b2b683b6d5a1e8 /src/model/misc.rs | |
| parent | Mutably borrow on `ChannelId`'s `edit`-method. (#447) (diff) | |
| download | serenity-8cb1bdc6cf992cc55810f5af753666d54f2237d5.tar.xz serenity-8cb1bdc6cf992cc55810f5af753666d54f2237d5.zip | |
Remove global Cache (#448)
* Update to use Rust 2018.
* Update examples and use Rust 2018.
* Pass cache via `Context` around instead of being global.
* Remove `lazy_static` from `cache`-feature.
* Update examples to use `Context`'s cache.
* Replace cache's update-timeout-setting with `update_cache_timeout`.
* Update documentation to stop using global cache.
* Move `HttpAndCache` to `lib.rs`.
* Add `__nonexhaustive`-field to `CacheAndHttp`.
* Add `__nonexhaustive` in `CacheAndHttp`-initialisers.
* Avoid `__nonexhaustive`-usage in doctest.
* Remove unnecessary comma in `cfg`-attribute.
Diffstat (limited to 'src/model/misc.rs')
| -rw-r--r-- | src/model/misc.rs | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/model/misc.rs b/src/model/misc.rs index e2adbcc..5726af6 100644 --- a/src/model/misc.rs +++ b/src/model/misc.rs @@ -112,20 +112,6 @@ impl StdError for UserParseError { } } -#[cfg(all(feature = "model", feature = "utils"))] -impl FromStr for User { - type Err = UserParseError; - - fn from_str(s: &str) -> StdResult<Self, Self::Err> { - match utils::parse_username(s) { - Some(x) => UserId(x as u64) - .to_user() - .map_err(|e| UserParseError::Rest(Box::new(e))), - _ => Err(UserParseError::InvalidUsername), - } - } -} - macro_rules! impl_from_str { (id: $($id:tt, $err:ident;)*) => { $( |