From 3b9c6b8719f5de3524c29d743c15c4d4c79984e0 Mon Sep 17 00:00:00 2001 From: Scott Lamb Date: Thu, 28 Apr 2022 22:19:20 -0700 Subject: [PATCH] bump minimum Rust version to 1.56 The last commit needs at least 1.53 for its use of array's IntoIterator impl. We might as well bump up to 1.56 and take advantage of the 2021 edition. --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 1 + Cargo.toml | 3 ++- src/codec/h264.rs | 3 ++- src/rtp.rs | 5 +++-- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e631d59..725615a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: matrix: rust: - stable - - 1.52 + - 1.56 include: - rust: stable extra_components: rustfmt diff --git a/CHANGELOG.md b/CHANGELOG.md index f321fed..4a30d62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ * BREAKING: `retina::client::rtp::Packet` is now `retina::rtp::ReceivedPacket`, and field access has been removed in favor of accessors. +* minimum Rust version is now 1.56. ## `v0.3.9` (2022-04-12) diff --git a/Cargo.toml b/Cargo.toml index b9659be..22dc0a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,12 +3,13 @@ name = "retina" version = "0.4.0-alpha.0" authors = ["Scott Lamb "] license = "MIT/Apache-2.0" -edition = "2018" +edition = "2021" keywords = ["rtsp", "multimedia", "video", "streaming", "ip-camera"] categories = ["network-programming", "multimedia"] description = "high-level RTSP multimedia streaming library" repository = "https://github.com/scottlamb/retina" include = ["src/**/*", "benches", "Cargo.toml"] +rust-version = "1.56" [dependencies] base64 = "0.13.0" diff --git a/src/codec/h264.rs b/src/codec/h264.rs index a7f1070..1cca4e3 100644 --- a/src/codec/h264.rs +++ b/src/codec/h264.rs @@ -881,7 +881,8 @@ impl Packetizer { data.advance(1); let fu_indicator = (hdr.nal_ref_idc() << 5) | 28; let fu_header = 0b1000_0000 | hdr.nal_unit_type().id(); // START bit set. - let payload = IntoIterator::into_iter([fu_indicator, fu_header]) + let payload = [fu_indicator, fu_header] + .into_iter() .chain(data[..max_payload_size - 2].iter().copied()); // TODO: ctx and channel_id are placeholders. let pkt = ReceivedPacketBuilder { diff --git a/src/rtp.rs b/src/rtp.rs index e998bc8..c909688 100644 --- a/src/rtp.rs +++ b/src/rtp.rs @@ -199,10 +199,11 @@ impl RawPacketBuilder { if self.payload_type >= 0x80 { return Err("payload type too large"); } - let data: Bytes = IntoIterator::into_iter([ + let data: Bytes = [ 2 << 6, // version=2, no padding, no extensions, no CSRCs. if self.mark { 0b1000_0000 } else { 0 } | self.payload_type, - ]) + ] + .into_iter() .chain(self.sequence_number.to_be_bytes()) .chain(self.timestamp.to_be_bytes()) .chain(self.ssrc.to_be_bytes())