diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2021-03-25 23:59:14 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2021-03-25 23:59:14 +0300 |
commit | bb8931c39bfe3d5a3edba4dbee77e0d22724447a (patch) | |
tree | 2b9e25390732a66f097d8a3db8166a9faa350c98 /video | |
parent | 9acacbb320820d8850391bde1ff98343d8156de8 (diff) |
closedcaption: Don't needlessly create a full-range subslice of a slice
Diffstat (limited to 'video')
-rw-r--r-- | video/closedcaption/tests/mcc_enc.rs | 2 | ||||
-rw-r--r-- | video/closedcaption/tests/scc_enc.rs | 2 | ||||
-rw-r--r-- | video/closedcaption/tests/scc_parse.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/video/closedcaption/tests/mcc_enc.rs b/video/closedcaption/tests/mcc_enc.rs index f6b460792..1244bacfa 100644 --- a/video/closedcaption/tests/mcc_enc.rs +++ b/video/closedcaption/tests/mcc_enc.rs @@ -118,7 +118,7 @@ Time Code Rate=30DF\r\n\ .unwrap(); let buf = { - let mut buf = gst::Buffer::from_mut_slice(Vec::from(&input[..])); + let mut buf = gst::Buffer::from_mut_slice(Vec::from(input)); let buf_ref = buf.get_mut().unwrap(); gst_video::VideoTimeCodeMeta::add(buf_ref, &tc); buf_ref.set_pts(gst::ClockTime::from_seconds(0)); diff --git a/video/closedcaption/tests/scc_enc.rs b/video/closedcaption/tests/scc_enc.rs index e5d00c90b..ee7e47caa 100644 --- a/video/closedcaption/tests/scc_enc.rs +++ b/video/closedcaption/tests/scc_enc.rs @@ -144,7 +144,7 @@ fn test_encode_multiple_packets() { let mut buffers = input2 .chunks(2) .map(move |bytes| { - let mut buf = gst::Buffer::from_mut_slice(Vec::from(&bytes[..])); + let mut buf = gst::Buffer::from_mut_slice(Vec::from(bytes)); let buf_ref = buf.get_mut().unwrap(); gst_video::VideoTimeCodeMeta::add(buf_ref, &t); t.increment_frame(); diff --git a/video/closedcaption/tests/scc_parse.rs b/video/closedcaption/tests/scc_parse.rs index 5b0e848b5..464f9afa1 100644 --- a/video/closedcaption/tests/scc_parse.rs +++ b/video/closedcaption/tests/scc_parse.rs @@ -157,7 +157,7 @@ fn test_timecodes() { let mut checksum = 0u32; let mut expected_timecode = valid_timecodes.pop_front().unwrap(); - let buf = gst::Buffer::from_mut_slice(Vec::from(&data[..])); + let buf = gst::Buffer::from_mut_slice(Vec::from(data)); assert_eq!(h.push(buf), Ok(gst::FlowSuccess::Ok)); while let Some(buf) = h.try_pull() { output_len += buf.get_size(); |