From f9b5420c0a3e8709e9b370bb492f571468808179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 28 Oct 2022 11:04:01 +0300 Subject: [PATCH] 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 --- src/playlist.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/playlist.rs b/src/playlist.rs index 14d033f..8beaec0 100644 --- a/src/playlist.rs +++ b/src/playlist.rs @@ -412,7 +412,7 @@ impl TryFrom for ClosedCaptionGroupId { fn try_from(s: QuotedOrUnquoted) -> Result { 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)), } }