Skip to content

Commit

Permalink
Drop unnecessary &mut
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero authored and dholroyd committed Dec 1, 2022
1 parent 33d853a commit 8a81897
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/pes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ mod test {

#[test]
fn parse_header() {
let data = make_test_data(|mut w| {
let data = make_test_data(|w| {
w.write(24, 1)?; // packet_start_code_prefix
w.write(8, 7)?; // stream_id
w.write(16, 7)?; // PES_packet_length
Expand Down Expand Up @@ -1198,7 +1198,7 @@ mod test {
#[test]
fn pts() {
let pts_prefix = 0b0010;
let pts = make_test_data(|mut w| {
let pts = make_test_data(|w| {
write_ts(w, 0b1_0101_0101_0101_0101_0101_0101_0101_0101, pts_prefix)
});
let a = pes::Timestamp::from_pts_bytes(&pts[..]).unwrap().value();
Expand All @@ -1213,7 +1213,7 @@ mod test {
#[test]
fn dts() {
let pts_prefix = 0b0001;
let pts = make_test_data(|mut w| {
let pts = make_test_data(|w| {
write_ts(w, 0b0_1010_1010_1010_1010_1010_1010_1010_1010, pts_prefix)
});
let a = pes::Timestamp::from_dts_bytes(&pts[..]).unwrap().value();
Expand All @@ -1228,7 +1228,7 @@ mod test {
#[test]
fn timestamp_ones() {
let pts_prefix = 0b0010;
let pts = make_test_data(|mut w| {
let pts = make_test_data(|w| {
write_ts(w, 0b1_1111_1111_1111_1111_1111_1111_1111_1111, pts_prefix)
});
let a = pes::Timestamp::from_pts_bytes(&pts[..]).unwrap().value();
Expand All @@ -1243,7 +1243,7 @@ mod test {
#[test]
fn timestamp_zeros() {
let pts_prefix = 0b0010;
let pts = make_test_data(|mut w| {
let pts = make_test_data(|w| {
write_ts(w, 0b0_0000_0000_0000_0000_0000_0000_0000_0000, pts_prefix)
});
let a = pes::Timestamp::from_pts_bytes(&pts[..]).unwrap().value();
Expand All @@ -1258,7 +1258,7 @@ mod test {
#[test]
fn timestamp_bad_prefix() {
let pts_prefix = 0b0010;
let mut pts = make_test_data(|mut w| write_ts(w, 1234, pts_prefix));
let mut pts = make_test_data(|w| write_ts(w, 1234, pts_prefix));
// make the prefix bits invalid by flipping a 0 to a 1,
pts[0] |= 0b10000000;
assert_matches!(
Expand All @@ -1273,7 +1273,7 @@ mod test {
#[test]
fn timestamp_bad_marker() {
let pts_prefix = 0b0010;
let mut pts = make_test_data(|mut w| write_ts(w, 1234, pts_prefix));
let mut pts = make_test_data(|w| write_ts(w, 1234, pts_prefix));
// make the first maker_bit (at index 7) invalid, by flipping a 1 to a 0,
pts[0] &= 0b11111110;
assert_matches!(
Expand Down

0 comments on commit 8a81897

Please sign in to comment.