diff options
author | AdaShoelace <adashoelace@gmail.com> | 2021-01-21 22:24:15 +0100 |
---|---|---|
committer | AdaShoelace <adashoelace@gmail.com> | 2021-01-21 22:24:15 +0100 |
commit | 861a986567310dfe9ccd85d2976b0ebfb683c818 (patch) | |
tree | 65ec9c5397bf7de009f3484ea161e77df2120f67 /src/utils/mpd.rs | |
parent | e6f9ce2ed5da0eb833d548a613c3b70360c9f4b5 (diff) |
Change to serde
Change config serializer to serde in order to get cleaner config types.
Diffstat (limited to 'src/utils/mpd.rs')
-rw-r--r-- | src/utils/mpd.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utils/mpd.rs b/src/utils/mpd.rs index e521c4f..b7fdbd6 100644 --- a/src/utils/mpd.rs +++ b/src/utils/mpd.rs @@ -1,10 +1,10 @@ -use crate::types::Config; +use crate::config::CONFIG; use mpd::{Client, Song}; // yes, error handling looks fucking sucks! // getting mpd song file -pub fn get_mpd_current(config: &Config) -> String { - let stream_path = format!("{}:{}", config.mpd.host, config.mpd.port); +pub fn get_mpd_current() -> String { + let stream_path = format!("{}:{}", CONFIG.mpd.host, CONFIG.mpd.port); let empty_string = String::from(""); let mut conn = match Client::connect(&stream_path) { Ok(connection) => connection, @@ -20,7 +20,7 @@ pub fn get_mpd_current(config: &Config) -> String { let result = format!( " {} {} {}", - config.mpd.icon, current.file, config.seperator + CONFIG.mpd.icon, current.file, CONFIG.seperator ); result |