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.
This commit is contained in:
Scott Lamb 2022-04-28 22:19:20 -07:00
parent d664f6b1af
commit 3b9c6b8719
5 changed files with 9 additions and 5 deletions

View File

@ -12,7 +12,7 @@ jobs:
matrix: matrix:
rust: rust:
- stable - stable
- 1.52 - 1.56
include: include:
- rust: stable - rust: stable
extra_components: rustfmt extra_components: rustfmt

View File

@ -17,6 +17,7 @@
* BREAKING: `retina::client::rtp::Packet` is now * BREAKING: `retina::client::rtp::Packet` is now
`retina::rtp::ReceivedPacket`, and field access has been removed in favor `retina::rtp::ReceivedPacket`, and field access has been removed in favor
of accessors. of accessors.
* minimum Rust version is now 1.56.
## `v0.3.9` (2022-04-12) ## `v0.3.9` (2022-04-12)

View File

@ -3,12 +3,13 @@ name = "retina"
version = "0.4.0-alpha.0" version = "0.4.0-alpha.0"
authors = ["Scott Lamb <slamb@slamb.org>"] authors = ["Scott Lamb <slamb@slamb.org>"]
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
edition = "2018" edition = "2021"
keywords = ["rtsp", "multimedia", "video", "streaming", "ip-camera"] keywords = ["rtsp", "multimedia", "video", "streaming", "ip-camera"]
categories = ["network-programming", "multimedia"] categories = ["network-programming", "multimedia"]
description = "high-level RTSP multimedia streaming library" description = "high-level RTSP multimedia streaming library"
repository = "https://github.com/scottlamb/retina" repository = "https://github.com/scottlamb/retina"
include = ["src/**/*", "benches", "Cargo.toml"] include = ["src/**/*", "benches", "Cargo.toml"]
rust-version = "1.56"
[dependencies] [dependencies]
base64 = "0.13.0" base64 = "0.13.0"

View File

@ -881,7 +881,8 @@ impl Packetizer {
data.advance(1); data.advance(1);
let fu_indicator = (hdr.nal_ref_idc() << 5) | 28; let fu_indicator = (hdr.nal_ref_idc() << 5) | 28;
let fu_header = 0b1000_0000 | hdr.nal_unit_type().id(); // START bit set. 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()); .chain(data[..max_payload_size - 2].iter().copied());
// TODO: ctx and channel_id are placeholders. // TODO: ctx and channel_id are placeholders.
let pkt = ReceivedPacketBuilder { let pkt = ReceivedPacketBuilder {

View File

@ -199,10 +199,11 @@ impl RawPacketBuilder {
if self.payload_type >= 0x80 { if self.payload_type >= 0x80 {
return Err("payload type too large"); 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. 2 << 6, // version=2, no padding, no extensions, no CSRCs.
if self.mark { 0b1000_0000 } else { 0 } | self.payload_type, if self.mark { 0b1000_0000 } else { 0 } | self.payload_type,
]) ]
.into_iter()
.chain(self.sequence_number.to_be_bytes()) .chain(self.sequence_number.to_be_bytes())
.chain(self.timestamp.to_be_bytes()) .chain(self.timestamp.to_be_bytes())
.chain(self.ssrc.to_be_bytes()) .chain(self.ssrc.to_be_bytes())