aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-06-04 14:21:09 -0700
committerZeyla Hellyer <[email protected]>2017-06-04 14:38:24 -0700
commit96ce530a113ca4290775a04390a7a79a3815cc3c (patch)
tree122852c637d88af8c7b6c7c0d19fc9c26c05b8ee /src/model
parentFix links to ChannelId::send_files (diff)
downloadserenity-96ce530a113ca4290775a04390a7a79a3815cc3c.tar.xz
serenity-96ce530a113ca4290775a04390a7a79a3815cc3c.zip
Alphabetize CurrentUser/User methods
Diffstat (limited to 'src/model')
-rw-r--r--src/model/user.rs70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/model/user.rs b/src/model/user.rs
index b1e0e07..441944d 100644
--- a/src/model/user.rs
+++ b/src/model/user.rs
@@ -140,32 +140,6 @@ impl CurrentUser {
http::get_guilds(&GuildPagination::After(GuildId(1)), 100)
}
- /// Returns a static formatted URL of the user's icon, if one exists.
- ///
- /// This will always produce a WEBP image URL.
- ///
- /// # Examples
- ///
- /// Print out the current user's static avatar url if one is set:
- ///
- /// ```rust,no_run
- /// # use serenity::client::CACHE;
- /// #
- /// # let cache = CACHE.read().unwrap();
- /// #
- /// // assuming the cache has been unlocked
- /// let user = &cache.user;
- ///
- /// match user.static_avatar_url() {
- /// Some(url) => println!("{}'s static avatar can be found at {}", user.name, url),
- /// None => println!("Could not get static avatar for {}.", user.name)
- /// }
- /// ```
- #[inline]
- pub fn static_avatar_url(&self) -> Option<String> {
- static_avatar_url(self.id, self.avatar.as_ref())
- }
-
/// Returns the invite url for the bot with the given permissions.
///
/// If the permissions passed are empty, the permissions part will be dropped.
@@ -213,6 +187,32 @@ impl CurrentUser {
}
}
+ /// Returns a static formatted URL of the user's icon, if one exists.
+ ///
+ /// This will always produce a WEBP image URL.
+ ///
+ /// # Examples
+ ///
+ /// Print out the current user's static avatar url if one is set:
+ ///
+ /// ```rust,no_run
+ /// # use serenity::client::CACHE;
+ /// #
+ /// # let cache = CACHE.read().unwrap();
+ /// #
+ /// // assuming the cache has been unlocked
+ /// let user = &cache.user;
+ ///
+ /// match user.static_avatar_url() {
+ /// Some(url) => println!("{}'s static avatar can be found at {}", user.name, url),
+ /// None => println!("Could not get static avatar for {}.", user.name)
+ /// }
+ /// ```
+ #[inline]
+ pub fn static_avatar_url(&self) -> Option<String> {
+ static_avatar_url(self.id, self.avatar.as_ref())
+ }
+
/// Returns the tag of the current user.
///
/// # Examples
@@ -363,15 +363,6 @@ impl User {
self.id.create_dm_channel()
}
- /// Alias of [`tag`].
- ///
- /// [`tag`]: #method.tag
- #[deprecated(since="0.2.0", note="Use `tag` instead.")]
- #[inline]
- pub fn distinct(&self) -> String {
- self.tag()
- }
-
/// Retrieves the time that this user was created at.
#[inline]
pub fn created_at(&self) -> Timespec {
@@ -456,6 +447,15 @@ impl User {
http::send_message(private_channel_id.0, &map)
}
+ /// Alias of [`tag`].
+ ///
+ /// [`tag`]: #method.tag
+ #[deprecated(since="0.2.0", note="Use `tag` instead.")]
+ #[inline]
+ pub fn distinct(&self) -> String {
+ self.tag()
+ }
+
/// This is an alias of [direct_message].
///
/// # Examples