Remove unused file
was previously used for notes during prototype phase
This commit is contained in:
parent
44cc3f4bdf
commit
fadd962e8a
1 changed files with 0 additions and 46 deletions
46
src/foo.rs
46
src/foo.rs
|
@ -1,46 +0,0 @@
|
|||
fn list_all() {
|
||||
PlayerFinder::new()
|
||||
.expect("Could not connect to D-Bus")
|
||||
.find_all()
|
||||
.unwrap_or_else(|_| Vec::new())
|
||||
.into_iter()
|
||||
.map(|player| player.identity().to_string())
|
||||
.unique()
|
||||
.for_each(|player| println!("{}", player));
|
||||
}
|
||||
fn get_player(player_id: &str) -> Player {
|
||||
PlayerFinder::new()
|
||||
.expect("Could not connect to D-Bus")
|
||||
.find_by_name(player_id)
|
||||
.expect("Could not find any player")
|
||||
}
|
||||
|
||||
fn increase_volume(player_id: &str, steps: f64) {
|
||||
let player = get_player(player_id);
|
||||
let volume = player.get_volume().expect("Could not get volume");
|
||||
player.set_volume(volume + steps).expect("Could not pause");
|
||||
}
|
||||
fn decrease_volume(player_id: &str, steps: f64) {
|
||||
increase_volume(player_id, -steps)
|
||||
}
|
||||
|
||||
|
||||
let filename = "foo.toml";
|
||||
|
||||
let contents = match fs::read_to_string(filename) {
|
||||
Ok(c) => c,
|
||||
Err(_) => {
|
||||
eprintln!("Could not read file `{}`", filename);
|
||||
std::process::exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//let config: Config = match toml::from_str(&contents) {
|
||||
// Ok(c) => c,
|
||||
// Err(_) => {
|
||||
// eprintln!("Could not parse TOML");
|
||||
// std::process::exit(1);
|
||||
// }
|
||||
//};
|
||||
|
Loading…
Reference in a new issue