Fix clippy warning

warning: useless conversion to the same type: `std::string::String`
   --> src/playlist.rs:415:77
    |
415 |             QuotedOrUnquoted::Unquoted(s) => Ok(ClosedCaptionGroupId::Other(String::from(s))),
    |                                                                             ^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `s`
    |
    = note: `#[warn(clippy::useless_conversion)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
This commit is contained in:
Sebastian Dröge 2022-10-28 11:04:01 +03:00
parent 14d24b94c8
commit f9b5420c0a

View file

@ -412,7 +412,7 @@ impl TryFrom<QuotedOrUnquoted> for ClosedCaptionGroupId {
fn try_from(s: QuotedOrUnquoted) -> Result<ClosedCaptionGroupId, String> {
match s {
QuotedOrUnquoted::Unquoted(s) if s == "NONE" => Ok(ClosedCaptionGroupId::None),
QuotedOrUnquoted::Unquoted(s) => Ok(ClosedCaptionGroupId::Other(String::from(s))),
QuotedOrUnquoted::Unquoted(s) => Ok(ClosedCaptionGroupId::Other(s)),
QuotedOrUnquoted::Quoted(s) => Ok(ClosedCaptionGroupId::GroupId(s)),
}
}