diff options
| author | Zeyla Hellyer <[email protected]> | 2017-08-18 16:14:32 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-08-18 17:52:53 -0700 |
| commit | e4113570967a1fb13539efbfa2cf7285b19d95ba (patch) | |
| tree | 06bb020fcfaa5f8323454dfb525272314a900186 /src/model/user.rs | |
| parent | Move Clippy lints to a cfg_attr (diff) | |
| download | serenity-e4113570967a1fb13539efbfa2cf7285b19d95ba.tar.xz serenity-e4113570967a1fb13539efbfa2cf7285b19d95ba.zip | |
Apply rustfmt
Diffstat (limited to 'src/model/user.rs')
| -rw-r--r-- | src/model/user.rs | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/model/user.rs b/src/model/user.rs index 16d5a06..7d26fd4 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -88,7 +88,10 @@ impl CurrentUser { pub fn edit<F>(&mut self, f: F) -> Result<()> where F: FnOnce(EditProfile) -> EditProfile { let mut map = Map::new(); - map.insert("username".to_owned(), Value::String(self.name.clone())); + map.insert( + "username".to_owned(), + Value::String(self.name.clone()), + ); if let Some(email) = self.email.as_ref() { map.insert("email".to_owned(), Value::String(email.clone())); @@ -113,8 +116,9 @@ impl CurrentUser { /// [`avatar_url`]: #method.avatar_url /// [`default_avatar_url`]: #method.default_avatar_url pub fn face(&self) -> String { - self.avatar_url() - .unwrap_or_else(|| self.default_avatar_url()) + self.avatar_url().unwrap_or_else( + || self.default_avatar_url(), + ) } /// Gets a list of guilds that the current user is in. @@ -487,7 +491,8 @@ impl User { return Err(Error::Model(ModelError::MessagingBot)); } - let private_channel_id = feature_cache! {{ + let private_channel_id = + feature_cache! {{ let finding = { let cache = CACHE.read().unwrap(); @@ -554,8 +559,9 @@ impl User { /// [`avatar_url`]: #method.avatar_url /// [`default_avatar_url`]: #method.default_avatar_url pub fn face(&self) -> String { - self.avatar_url() - .unwrap_or_else(|| self.default_avatar_url()) + self.avatar_url().unwrap_or_else( + || self.default_avatar_url(), + ) } /// Check if a user has a [`Role`]. This will retrieve the [`Guild`] from @@ -792,7 +798,9 @@ fn default_avatar_url(discriminator: u16) -> String { #[cfg(feature = "model")] fn static_avatar_url(user_id: UserId, hash: Option<&String>) -> Option<String> { - hash.map(|hash| cdn!("/avatars/{}/{}.webp?size=1024", user_id, hash)) + hash.map( + |hash| cdn!("/avatars/{}/{}.webp?size=1024", user_id, hash), + ) } #[cfg(feature = "model")] |