mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-06 03:50:06 +02:00
Update to Rust 2018
- Fix deprecated Error::cause warnings and missing dyn - Reset max_width - Add rustfmt to Travis - Run rustfmt on full codebase with `cargo fmt --all` - Add rustfmt to Travis - Complete migration to edition 2018 - Replace try! shorthand - Use explicit `dyn Trait`
This commit is contained in:
parent
be2ad9059a
commit
d26590afc5
45 changed files with 331 additions and 238 deletions
19
src/main.rs
19
src/main.rs
|
@ -184,7 +184,13 @@ fn setup(args: &[String]) -> Setup {
|
|||
let matches = match opts.parse(&args[1..]) {
|
||||
Ok(m) => m,
|
||||
Err(f) => {
|
||||
writeln!(stderr(), "error: {}\n{}", f.to_string(), usage(&args[0], &opts)).unwrap();
|
||||
writeln!(
|
||||
stderr(),
|
||||
"error: {}\n{}",
|
||||
f.to_string(),
|
||||
usage(&args[0], &opts)
|
||||
)
|
||||
.unwrap();
|
||||
exit(1);
|
||||
}
|
||||
};
|
||||
|
@ -218,7 +224,9 @@ fn setup(args: &[String]) -> Setup {
|
|||
let mixer = mixer::find(mixer_name.as_ref()).expect("Invalid mixer");
|
||||
|
||||
let mixer_config = MixerConfig {
|
||||
card: matches.opt_str("mixer-card").unwrap_or(String::from("default")),
|
||||
card: matches
|
||||
.opt_str("mixer-card")
|
||||
.unwrap_or(String::from("default")),
|
||||
mixer: matches.opt_str("mixer-name").unwrap_or(String::from("PCM")),
|
||||
index: matches
|
||||
.opt_str("mixer-index")
|
||||
|
@ -400,7 +408,8 @@ impl Main {
|
|||
let config = task.connect_config.clone();
|
||||
let device_id = task.session_config.device_id.clone();
|
||||
|
||||
task.discovery = Some(discovery(&handle, config, device_id, setup.zeroconf_port).unwrap());
|
||||
task.discovery =
|
||||
Some(discovery(&handle, config, device_id, setup.zeroconf_port).unwrap());
|
||||
}
|
||||
|
||||
if let Some(credentials) = setup.credentials {
|
||||
|
@ -433,7 +442,9 @@ impl Future for Main {
|
|||
loop {
|
||||
let mut progress = false;
|
||||
|
||||
if let Some(Async::Ready(Some(creds))) = self.discovery.as_mut().map(|d| d.poll().unwrap()) {
|
||||
if let Some(Async::Ready(Some(creds))) =
|
||||
self.discovery.as_mut().map(|d| d.poll().unwrap())
|
||||
{
|
||||
if let Some(ref spirc) = self.spirc {
|
||||
spirc.shutdown();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue