diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b584c0897..8d8d5a121 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -352,13 +352,13 @@ clippy: echo "Running clippy on $crate with $FEATURES" - cargo clippy --locked --color=always --manifest-path $crate/Cargo.toml $FEATURES --all-targets -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -A clippy::missing_safety_doc -A clippy::manual_range_contains -A clippy::field_reassign_with_default -D warnings + cargo clippy --locked --color=always --manifest-path $crate/Cargo.toml $FEATURES --all-targets -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -A clippy::missing_safety_doc -A clippy::manual_range_contains -D warnings fi done # And also run over all the examples/tutorials - | - cargo clippy --locked --color=always --manifest-path examples/Cargo.toml --all-targets --all-features -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -A clippy::missing_safety_doc -A clippy::manual_range_contains -A clippy::field_reassign_with_default -D warnings - cargo clippy --locked --color=always --manifest-path tutorials/Cargo.toml --all-targets --all-features -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -A clippy::missing_safety_doc -A clippy::manual_range_contains -A clippy::field_reassign_with_default -D warnings + cargo clippy --locked --color=always --manifest-path examples/Cargo.toml --all-targets --all-features -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -A clippy::missing_safety_doc -A clippy::manual_range_contains -D warnings + cargo clippy --locked --color=always --manifest-path tutorials/Cargo.toml --all-targets --all-features -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -A clippy::missing_safety_doc -A clippy::manual_range_contains -D warnings deny: extends: .img-stable diff --git a/gstreamer/src/buffer_serde.rs b/gstreamer/src/buffer_serde.rs index 58c2b4c5c..fe298576f 100644 --- a/gstreamer/src/buffer_serde.rs +++ b/gstreamer/src/buffer_serde.rs @@ -92,8 +92,7 @@ mod tests { buffer.set_flags(BufferFlags::LIVE | BufferFlags::DISCONT); } - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); let res = ron::ser::to_string_pretty(&buffer, pretty_config); assert_eq!( diff --git a/gstreamer/src/bufferlist_serde.rs b/gstreamer/src/bufferlist_serde.rs index 770d19617..29161dea1 100644 --- a/gstreamer/src/bufferlist_serde.rs +++ b/gstreamer/src/bufferlist_serde.rs @@ -94,8 +94,7 @@ mod tests { buffer_list.add(buffer); } - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); let res = ron::ser::to_string_pretty(&buffer_list, pretty_config); assert_eq!( diff --git a/gstreamer/src/caps_serde.rs b/gstreamer/src/caps_serde.rs index c124ca140..5180b068c 100644 --- a/gstreamer/src/caps_serde.rs +++ b/gstreamer/src/caps_serde.rs @@ -240,8 +240,7 @@ mod tests { .field("array", &Array::new(&[&1, &2])) .build(); - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); let res = ron::ser::to_string_pretty(&caps, pretty_config); assert_eq!( @@ -272,8 +271,7 @@ mod tests { .features(&["foo:bar", "foo:baz"]) .build(); - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); let res = ron::ser::to_string_pretty(&caps, pretty_config); assert_eq!( @@ -307,8 +305,7 @@ mod tests { .any_features() .build(); - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); let res = ron::ser::to_string_pretty(&caps, pretty_config.clone()); assert_eq!( diff --git a/gstreamer/src/clock_time_serde.rs b/gstreamer/src/clock_time_serde.rs index 51343dc16..f22e8b171 100644 --- a/gstreamer/src/clock_time_serde.rs +++ b/gstreamer/src/clock_time_serde.rs @@ -55,8 +55,7 @@ mod tests { // Some let clocktime = ClockTime::from_nseconds(42_123_456_789); - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); let res = ron::ser::to_string_pretty(&clocktime, pretty_config.clone()); assert_eq!(Ok("Some(42123456789)".to_owned()), res); diff --git a/gstreamer/src/date_time_serde.rs b/gstreamer/src/date_time_serde.rs index 6d7d78f06..269f1789a 100644 --- a/gstreamer/src/date_time_serde.rs +++ b/gstreamer/src/date_time_serde.rs @@ -176,8 +176,7 @@ mod tests { fn test_serialize() { crate::init().unwrap(); - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); let datetime = DateTime::new(2f32, 2018, 5, 28, 16, 6, 42.123_456f64).unwrap(); let res = ron::ser::to_string_pretty(&datetime, pretty_config.clone()); diff --git a/gstreamer/src/format_serde.rs b/gstreamer/src/format_serde.rs index 5a974df6a..80fe5e04a 100644 --- a/gstreamer/src/format_serde.rs +++ b/gstreamer/src/format_serde.rs @@ -67,8 +67,7 @@ mod tests { fn test_serialize() { crate::init().unwrap(); - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); let value = GenericFormattedValue::Undefined(Undefined::from(42)); let res = ron::ser::to_string_pretty(&value, pretty_config.clone()); diff --git a/gstreamer/src/sample_serde.rs b/gstreamer/src/sample_serde.rs index 13e0b43f0..c36f04bbe 100644 --- a/gstreamer/src/sample_serde.rs +++ b/gstreamer/src/sample_serde.rs @@ -90,8 +90,7 @@ mod tests { fn test_serialize() { crate::init().unwrap(); - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); let sample = { let mut buffer = Buffer::from_slice(vec![1, 2, 3, 4]); diff --git a/gstreamer/src/segment_serde.rs b/gstreamer/src/segment_serde.rs index 3067a8f9b..03f834490 100644 --- a/gstreamer/src/segment_serde.rs +++ b/gstreamer/src/segment_serde.rs @@ -131,8 +131,7 @@ mod tests { segment.set_position(GenericFormattedValue::Time(ClockTime::from_nseconds(256))); segment.set_duration(GenericFormattedValue::Time(ClockTime::none())); - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); let res = ron::ser::to_string_pretty(&segment, pretty_config); assert_eq!( diff --git a/gstreamer/src/structure_serde.rs b/gstreamer/src/structure_serde.rs index 6d774371e..af5d1f167 100644 --- a/gstreamer/src/structure_serde.rs +++ b/gstreamer/src/structure_serde.rs @@ -186,8 +186,7 @@ mod tests { .field("array", &Array::new(&[&1, &2])) .build(); - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); let res = ron::ser::to_string_pretty(&s, pretty_config); assert_eq!( diff --git a/gstreamer/src/tags_serde.rs b/gstreamer/src/tags_serde.rs index 8e12dfacd..5633bc98d 100644 --- a/gstreamer/src/tags_serde.rs +++ b/gstreamer/src/tags_serde.rs @@ -361,8 +361,7 @@ mod tests { tags.add::(&sample, TagMergeMode::Append); // Sample } - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); let res = ron::ser::to_string_pretty(&tags, pretty_config); assert_eq!( diff --git a/gstreamer/src/toc_serde.rs b/gstreamer/src/toc_serde.rs index b790c9958..ca6cf78c4 100644 --- a/gstreamer/src/toc_serde.rs +++ b/gstreamer/src/toc_serde.rs @@ -191,8 +191,7 @@ mod tests { toc.append_entry(toc_edition); } - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); let res = ron::ser::to_string_pretty(&toc, pretty_config); assert_eq!( diff --git a/gstreamer/src/value_serde.rs b/gstreamer/src/value_serde.rs index 8975e46e2..a697148e9 100644 --- a/gstreamer/src/value_serde.rs +++ b/gstreamer/src/value_serde.rs @@ -313,8 +313,7 @@ mod tests { fn test_serialize_simple() { crate::init().unwrap(); - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); // Fraction let fraction = Fraction::new(1, 3); @@ -356,8 +355,7 @@ mod tests { fn test_serialize_collections() { crate::init().unwrap(); - let mut pretty_config = ron::ser::PrettyConfig::default(); - pretty_config.new_line = "".to_string(); + let pretty_config = ron::ser::PrettyConfig::new().with_new_line("".to_string()); // Array let value_13 = Fraction::new(1, 3);