diff options
| author | acdenisSK <[email protected]> | 2018-09-21 22:45:14 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2018-09-22 18:34:32 +0200 |
| commit | d529cf79af4e493700aa9c69bbb690dbc47a80b8 (patch) | |
| tree | af23e20d1812a309707ccd2600c64f325bd925be /src/model | |
| parent | Make `trim` return `&mut self` (#395) (diff) | |
| download | serenity-d529cf79af4e493700aa9c69bbb690dbc47a80b8.tar.xz serenity-d529cf79af4e493700aa9c69bbb690dbc47a80b8.zip | |
Generalise mention parsing
Fixes #396
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/misc.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/model/misc.rs b/src/model/misc.rs index ff0f3de..9c09a9b 100644 --- a/src/model/misc.rs +++ b/src/model/misc.rs @@ -156,7 +156,7 @@ macro_rules! impl_from_str { type Err = $err; fn from_str(s: &str) -> StdResult<Self, Self::Err> { - Ok(match utils::parse_username(s) { + Ok(match utils::parse_mention(s) { Some(id) => $id(id), None => s.parse::<u64>().map($id).map_err(|_| $err::InvalidFormat)?, }) |