Skip to content

Commit

Permalink
Remove Context::{channel_id, queue}
Browse files Browse the repository at this point in the history
The `channel_id` field on Context is no longer required internally, and
is no longer of use to userland as event handlers are given the channel
ID in some way where possible.

`queue` is a remnant from when the Context was the primary way to
interact with the REST API.
  • Loading branch information
Zeyla Hellyer committed Jun 14, 2017
1 parent 0b95db9 commit 8b504ad
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 89 deletions.
13 changes: 1 addition & 12 deletions src/client/context.rs
Expand Up @@ -29,11 +29,6 @@ use ::http;
/// [`set_game`]: #method.set_game
#[derive(Clone)]
pub struct Context {
/// The Id of the relevant channel, if there is one. This is present on the
/// [`on_message`] handler, for example.
///
/// [`on_message`]: struct.Client.html#method.on_message
pub channel_id: Option<ChannelId>,
/// A clone of [`Client::data`]. Refer to its documentation for more
/// information.
///
Expand All @@ -44,8 +39,6 @@ pub struct Context {
/// Note that if you are sharding, in relevant terms, this is the shard
/// which received the event being dispatched.
pub shard: Arc<Mutex<Shard>>,
/// The queue of messages that are sent after context goes out of scope.
pub queue: String,
}

impl Context {
Expand All @@ -57,14 +50,10 @@ impl Context {
/// Or don't do what I say. I'm just a comment hidden from the generated
/// documentation.
#[doc(hidden)]
pub fn new(channel_id: Option<ChannelId>,
shard: Arc<Mutex<Shard>>,
data: Arc<Mutex<ShareMap>>) -> Context {
pub fn new(shard: Arc<Mutex<Shard>>, data: Arc<Mutex<ShareMap>>) -> Context {
Context {
channel_id: channel_id,
data: data,
shard: shard,
queue: String::new(),
}
}

Expand Down

0 comments on commit 8b504ad

Please sign in to comment.