Skip to content

Commit 9feef04

Browse files
committed
Move a map out of an and_then.
1 parent e23850f commit 9feef04

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/client.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ impl<S: Read + Write> Client<S> {
221221
/// Get current playing song
222222
pub fn currentsong(&mut self) -> Result<Option<Song>> {
223223
self.run_command("currentsong", ())
224-
.and_then(|_| self.read_struct::<Song>().map(|s| if s.place.is_none() { None } else { Some(s) }))
224+
.and_then(|_| self.read_struct::<Song>())
225+
.map(|s| if s.place.is_none() { None } else { Some(s) })
225226
}
226227

227228
/// Clear current queue

0 commit comments

Comments
 (0)