Skip to content

Commit

Permalink
api: be more relaxed with status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Sep 1, 2024
1 parent e80d374 commit 4275a07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/oxidize-api/src/spotify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ impl Spotify {
}
}

/// Handle device control requests.
/// Handle device control responses.
fn device_control<C>(status: StatusCode, _: &C) -> Result<Option<bool>> {
match status {
StatusCode::NO_CONTENT => Ok(Some(true)),
StatusCode::NOT_FOUND => Ok(Some(false)),
status if status.is_success() => Ok(Some(true)),
_ => Ok(None),
}
}

0 comments on commit 4275a07

Please sign in to comment.