diff options
| author | Austin Hellyer <[email protected]> | 2016-11-26 11:33:28 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-26 11:33:28 -0800 |
| commit | 23f1dc823d658ee66a51388b742b0d06c94560c9 (patch) | |
| tree | 6b4ccf467d31d45f1e8d6834fdda5bbb18c865f8 /src/client/context.rs | |
| parent | Remove the 'extras' feature flag (diff) | |
| download | serenity-23f1dc823d658ee66a51388b742b0d06c94560c9.tar.xz serenity-23f1dc823d658ee66a51388b742b0d06c94560c9.zip | |
Make Cache::get_channel return a reference
Additionally, allow it to search the groups' and private channels' maps
in the cache. As these are usually O(1) operations, it's cheap to allow,
in comparison to the current unoptimized method of getting a guild's
channel.
Diffstat (limited to 'src/client/context.rs')
| -rw-r--r-- | src/client/context.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/context.rs b/src/client/context.rs index 943741b..f420537 100644 --- a/src/client/context.rs +++ b/src/client/context.rs @@ -833,7 +833,7 @@ impl Context { feature_cache_enabled! {{ if let Some(channel) = CACHE.read().unwrap().get_channel(channel_id) { - return Ok(channel.clone()); + return Ok(channel.clone_inner()); } }} |