-fn update_map(arc_map: Arc<Mutex<HashMap<String, String>>>, key: String, val: String) {
+fn update_map(arc_map: Arc<Mutex<HashMap<String, String>>>, key: &str, val: &str) {
// Variant holding a variant that should just be a Vec<&str> I
// believe. This is _the recommended_ way to do this by the author.
let inner_value = value?.as_iter()?.next()?.as_iter()?.next()?;
// Variant holding a variant that should just be a Vec<&str> I
// believe. This is _the recommended_ way to do this by the author.
let inner_value = value?.as_iter()?.next()?.as_iter()?.next()?;
- let artist = String::from(inner_value.as_str()?);
- update_map(
- arc_locked_xset_map,
- String::from("artist"),
- String::from(artist),
- );
+ let artist = inner_value.as_str()?;
+ update_map(arc_locked_xset_map, "artist", artist);