From 052365ba1ade85dd10490cb156741226c66e6de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 30 Jul 2021 13:53:35 +0300 Subject: Fix various needless-borrow clippy warnings and others --- text/json/src/jsongstparse/imp.rs | 6 +++--- text/json/tests/json.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'text/json') diff --git a/text/json/src/jsongstparse/imp.rs b/text/json/src/jsongstparse/imp.rs index b722602a..78289922 100644 --- a/text/json/src/jsongstparse/imp.rs +++ b/text/json/src/jsongstparse/imp.rs @@ -130,7 +130,7 @@ impl State { } }; - let line: Line = serde_json::from_slice(&line).map_err(|err| (line, err))?; + let line: Line = serde_json::from_slice(line).map_err(|err| (line, err))?; Ok(Some(line)) } @@ -181,7 +181,7 @@ impl State { self.need_segment = false; } - events.extend(self.pending_events.drain(..)); + events.append(&mut self.pending_events); events } @@ -501,7 +501,7 @@ impl JsonGstParse { pts, duration, data: _data, - }) = serde_json::from_slice(&line) + }) = serde_json::from_slice(line) { last_pts = pts.zip(duration).map(|(pts, duration)| pts + duration); } diff --git a/text/json/tests/json.rs b/text/json/tests/json.rs index 80df4c2d..bbe35fb5 100644 --- a/text/json/tests/json.rs +++ b/text/json/tests/json.rs @@ -88,8 +88,8 @@ fn test_parse() { match ev.view() { EventView::Caps(ev) => { assert!(ev.caps().is_strictly_equal(&gst::Caps::new_simple( - &"application/x-json", - &[(&"format", &"test")] + "application/x-json", + &[("format", &"test")] ))); } _ => (), -- cgit v1.2.3