diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2021-07-30 13:53:35 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2021-07-30 13:53:35 +0300 |
commit | 052365ba1ade85dd10490cb156741226c66e6de5 (patch) | |
tree | 659856f3715b41ad27f6769db02c248065dde392 /text/json | |
parent | 67f566dd287bf19c3e51a2f893dec5b70c27b6a1 (diff) |
Fix various needless-borrow clippy warnings and others
Diffstat (limited to 'text/json')
-rw-r--r-- | text/json/src/jsongstparse/imp.rs | 6 | ||||
-rw-r--r-- | text/json/tests/json.rs | 4 |
2 files changed, 5 insertions, 5 deletions
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")] ))); } _ => (), |