From 861a986567310dfe9ccd85d2976b0ebfb683c818 Mon Sep 17 00:00:00 2001 From: AdaShoelace Date: Thu, 21 Jan 2021 22:24:15 +0100 Subject: Change to serde Change config serializer to serde in order to get cleaner config types. --- src/utils/mpd.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/utils/mpd.rs') 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 -- cgit v1.2.3