aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2017-01-09 14:38:48 -0800
committerAustin Hellyer <[email protected]>2017-01-09 14:38:48 -0800
commit69ec62a42bcb143cdde056ad8ffce81922e88317 (patch)
tree3cd47c4d2e9ea6680679868a3069299bc485b4db /src/model
parentUpdate icons/splashes to be WEBP (diff)
downloadserenity-69ec62a42bcb143cdde056ad8ffce81922e88317.tar.xz
serenity-69ec62a42bcb143cdde056ad8ffce81922e88317.zip
Use CDN for default avatars
Diffstat (limited to 'src/model')
-rw-r--r--src/model/user.rs14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/model/user.rs b/src/model/user.rs
index b1a1f16..83e80b9 100644
--- a/src/model/user.rs
+++ b/src/model/user.rs
@@ -2,7 +2,6 @@ use std::fmt;
use super::utils::{into_map, into_string, remove};
use super::{
CurrentUser,
- DefaultAvatar,
FriendSourceFlags,
GuildContainer,
GuildId,
@@ -156,18 +155,7 @@ impl User {
/// [`Error::Num`]: ../enum.Error.html#variant.Num
/// [`Error::Other`]: ../enum.Error.html#variant.Other
pub fn default_avatar_url(&self) -> Result<String> {
- Ok(base!("/assets/{}.png", match self.discriminator.parse::<u16>()? % 5u16 {
- 0 => DefaultAvatar::Blurple.name().to_owned(),
- 1 => DefaultAvatar::Grey.name().to_owned(),
- 2 => DefaultAvatar::Green.name().to_owned(),
- 3 => DefaultAvatar::Orange.name().to_owned(),
- 4 => DefaultAvatar::Red.name().to_owned(),
- other => {
- error!("Reached impossible default avatar match: {}", other);
-
- return Err(Error::Other("Reached impossible default match"));
- },
- }))
+ Ok(cdn!("/embed/avatars/{}.png", self.discriminator.parse::<u16>()? % 5u16).to_owned())
}
/// Send a direct message to a user. This will create or retrieve the