Fix skip command and add compile flags for release build

This commit is contained in:
hodasemi 2018-12-04 10:04:58 +01:00
parent 5a0412f3b8
commit 6e202646f4
2 changed files with 17 additions and 7 deletions

View file

@ -27,3 +27,8 @@ branch = "current"
[dependencies.parking_lot] [dependencies.parking_lot]
version = "^0.5" version = "^0.5"
[profile.release]
opt-level = 3
lto = true
codegen-units = 4

View file

@ -74,7 +74,9 @@ impl serenity::framework::standard::Command for Skip {
} }
}; };
*song = Some(handler.play_returning(source)); match self.media.next_callback.borrow().as_ref() {
Some(callback) => {
*song = Some(handler.play_returning_and_callback(source, callback.clone()));
let song_name = self.media.name_mut(); let song_name = self.media.name_mut();
*song_name.borrow_mut() = first.name.clone(); *song_name.borrow_mut() = first.name.clone();
@ -83,6 +85,9 @@ impl serenity::framework::standard::Command for Skip {
.say(format!("Skipped current song, now playing: {}", first.name)) .say(format!("Skipped current song, now playing: {}", first.name))
); );
} }
None => println!("error getting callback from media"),
}
}
} }
Ok(()) Ok(())