aboutsummaryrefslogtreecommitdiff
path: root/src/commands/sound_levels.rs
diff options
context:
space:
mode:
authorNathan Perry <np@nathanperry.dev>2019-11-17 23:51:56 -0500
committerNathan Perry <np@nathanperry.dev>2019-11-17 23:51:56 -0500
commit8a5a841e619793ce81b177179694712284be23e4 (patch)
tree6e8b46b1a008a94236e5aaaf48fad95dee70451a /src/commands/sound_levels.rs
parentc068e82d2b6341cf7896bfc2e1fd4683f28d67b4 (diff)
borrowck fixes
Diffstat (limited to 'src/commands/sound_levels.rs')
-rw-r--r--src/commands/sound_levels.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/commands/sound_levels.rs b/src/commands/sound_levels.rs
index 46695d2..648e54b 100644
--- a/src/commands/sound_levels.rs
+++ b/src/commands/sound_levels.rs
@@ -7,7 +7,6 @@ use log::{
use serenity::{
framework::standard::{
Args,
- CommandResult,
macros::command,
},
model::channel::Message,
@@ -15,6 +14,7 @@ use serenity::{
};
use crate::{
+ Result,
audio::{PlayQueue, VoiceManager},
TARGET_GUILD_ID,
util::CtxExt,
@@ -23,7 +23,7 @@ use crate::{
pub const DEFAULT_VOLUME: f32 = 0.10;
#[command]
-pub fn mute(ctx: &mut Context, _: &Message, _: Args) -> CommandResult {
+pub fn mute(ctx: &mut Context, _: &Message, _: Args) -> Result<()> {
let mgr_lock = ctx.data.write().get::<VoiceManager>().cloned().unwrap();
let mut manager = mgr_lock.lock();
@@ -41,7 +41,7 @@ pub fn mute(ctx: &mut Context, _: &Message, _: Args) -> CommandResult {
}
#[command]
-pub fn unmute(ctx: &mut Context, msg: &Message, _: Args) -> CommandResult {
+pub fn unmute(ctx: &mut Context, msg: &Message, _: Args) -> Result<()> {
let mgr_lock = ctx.data.write().get::<VoiceManager>().cloned().unwrap();
let mut manager = mgr_lock.lock();
@@ -60,7 +60,7 @@ pub fn unmute(ctx: &mut Context, msg: &Message, _: Args) -> CommandResult {
}
#[command]
-pub fn volume(ctx: &mut Context, msg: &Message, mut args: Args) -> CommandResult {
+pub fn volume(ctx: &mut Context, msg: &Message, mut args: Args) -> Result<()> {
if args.len() == 0 {
let vol = {
let queue_lock = ctx.data.write().get::<PlayQueue>().cloned().unwrap();