aboutsummaryrefslogtreecommitdiff
path: root/src/model/utils.rs
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-11-19 20:50:33 -0800
committerAustin Hellyer <[email protected]>2016-11-19 20:50:33 -0800
commit66f4acc63163a5f7bd528165ee5fe9ae7d44eb7d (patch)
tree357b4f4632138b6e0270c177cccd445b1c4f2d98 /src/model/utils.rs
parentFix type errors for non-framework builds (diff)
downloadserenity-66f4acc63163a5f7bd528165ee5fe9ae7d44eb7d.tar.xz
serenity-66f4acc63163a5f7bd528165ee5fe9ae7d44eb7d.zip
Rename state methods from find_ to get_
For consistency with the rest of the library, rename the methods prefixed with `find_` to `get_`. The past logic was that items are "found", as they may or may not exist. With get, the expectation is that it is _always_ there, i.e. over REST. However, this is inconsistent, and "get"ting over REST can fail for other reasons.
Diffstat (limited to 'src/model/utils.rs')
-rw-r--r--src/model/utils.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/model/utils.rs b/src/model/utils.rs
index 92dfbd9..db39939 100644
--- a/src/model/utils.rs
+++ b/src/model/utils.rs
@@ -278,7 +278,7 @@ pub fn user_has_perms(channel_id: ChannelId,
let state = STATE.lock().unwrap();
let current_user = &state.user;
- let channel = match state.find_channel(channel_id) {
+ let channel = match state.get_channel(channel_id) {
Some(channel) => channel,
None => return Err(Error::Client(ClientError::ItemMissing)),
};
@@ -290,7 +290,7 @@ pub fn user_has_perms(channel_id: ChannelId,
Channel::Public(channel) => channel.guild_id,
};
- let guild = match state.find_guild(guild_id) {
+ let guild = match state.get_guild(guild_id) {
Some(guild) => guild,
None => return Err(Error::Client(ClientError::ItemMissing)),
};