json: Don't needlessly create a full-range subslice of a slice

This commit is contained in:
Sebastian Dröge 2021-03-25 19:44:56 +02:00
parent 9d359d9341
commit f8adb42f7b

View file

@ -38,7 +38,7 @@ fn test_enc() {
h.set_src_caps_str("application/x-json, format=test");
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();
buf_ref.set_pts(gst::ClockTime::from_seconds(0));
buf_ref.set_duration(gst::ClockTime::from_seconds(2));