From 0a7d1639e7b33d0bd941997bb88762c35473f0d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 31 Oct 2021 12:54:12 +0200 Subject: [PATCH] Update to Rust edition 2021 and minimum supported Rust version to 1.56 --- .gitlab-ci.yml | 6 +++--- audio/audiofx/Cargo.toml | 3 ++- audio/claxon/Cargo.toml | 3 ++- audio/csound/Cargo.toml | 3 ++- audio/lewton/Cargo.toml | 3 ++- ci/install-rust-ext.sh | 3 +-- generic/file/Cargo.toml | 3 ++- generic/file/src/file_location.rs | 1 - generic/sodium/Cargo.toml | 3 ++- generic/sodium/src/decrypter/imp.rs | 2 -- generic/sodium/src/encrypter/imp.rs | 2 -- generic/threadshare/Cargo.toml | 3 ++- generic/threadshare/src/appsrc/imp.rs | 1 - generic/threadshare/src/udpsink/imp.rs | 2 -- net/reqwest/Cargo.toml | 3 ++- net/reqwest/src/reqwesthttpsrc/imp.rs | 13 +++++-------- net/rusoto/Cargo.toml | 3 ++- net/rusoto/src/s3sink/imp.rs | 5 ++--- net/rusoto/src/s3url.rs | 5 ++--- text/json/Cargo.toml | 3 ++- text/json/src/jsongstparse/imp.rs | 1 - text/regex/Cargo.toml | 3 ++- text/wrap/Cargo.toml | 3 ++- tutorial/Cargo.toml | 3 ++- utils/fallbackswitch/Cargo.toml | 3 ++- utils/fallbackswitch/src/fallbacksrc/imp.rs | 1 - utils/togglerecord/Cargo.toml | 3 ++- version-helper/Cargo.toml | 3 ++- version-helper/src/lib.rs | 1 - video/cdg/Cargo.toml | 3 ++- video/cdg/src/cdgparse/imp.rs | 1 - video/closedcaption/Cargo.toml | 3 ++- video/closedcaption/src/mcc_parse/imp.rs | 1 - video/closedcaption/src/scc_parse/imp.rs | 3 --- video/closedcaption/tests/scc_parse.rs | 5 +---- video/dav1d/Cargo.toml | 3 ++- video/dav1d/src/dav1ddec/imp.rs | 4 +--- video/ffv1/Cargo.toml | 3 ++- video/flavors/Cargo.toml | 3 ++- video/gif/Cargo.toml | 3 ++- video/gtk4/Cargo.toml | 3 ++- video/gtk4/src/sink/frame.rs | 1 - video/hsv/Cargo.toml | 3 ++- video/hsv/src/hsvdetector/imp.rs | 1 - video/hsv/src/hsvfilter/imp.rs | 1 - video/rav1e/Cargo.toml | 3 ++- video/rspng/Cargo.toml | 3 ++- video/webp/Cargo.toml | 3 ++- 48 files changed, 69 insertions(+), 72 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 50c97812..58e66f3f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,19 +43,19 @@ stages: .debian:11-stable: extends: .debian:11 variables: - FDO_DISTRIBUTION_TAG: '$GST_RS_STABLE-${GST_RS_IMG_TAG}_2021-10-23.0' + FDO_DISTRIBUTION_TAG: '$GST_RS_STABLE-${GST_RS_IMG_TAG}_2021-10-31.0' FDO_BASE_IMAGE: "registry.freedesktop.org/gstreamer/gstreamer-rs/debian/bullseye-slim:$GST_RS_STABLE-$GST_RS_IMG_TAG" .debian:11-msrv: extends: .debian:11 variables: - FDO_DISTRIBUTION_TAG: '$GST_RS_MSRV-${GST_RS_IMG_TAG}_2021-10-23.0' + FDO_DISTRIBUTION_TAG: '$GST_RS_MSRV-${GST_RS_IMG_TAG}_2021-10-31.0' FDO_BASE_IMAGE: "registry.freedesktop.org/gstreamer/gstreamer-rs/debian/bullseye-slim:$GST_RS_MSRV-$GST_RS_IMG_TAG" .debian:11-nightly: extends: .debian:11 variables: - FDO_DISTRIBUTION_TAG: 'nightly-${GST_RS_IMG_TAG}_2021-10-23.0' + FDO_DISTRIBUTION_TAG: 'nightly-${GST_RS_IMG_TAG}_2021-10-31.0' FDO_BASE_IMAGE: "registry.freedesktop.org/gstreamer/gstreamer-rs/debian/bullseye-slim:nightly-$GST_RS_IMG_TAG" .build-debian-container: diff --git a/audio/audiofx/Cargo.toml b/audio/audiofx/Cargo.toml index d8693560..6f6c9326 100644 --- a/audio/audiofx/Cargo.toml +++ b/audio/audiofx/Cargo.toml @@ -5,7 +5,8 @@ authors = ["Sebastian Dröge "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "LGPL-2.1-or-later" description = "Rust AudioFx Plugin" -edition = "2018" +edition = "2021" +rust-version = "1.56" [dependencies] gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"] } diff --git a/audio/claxon/Cargo.toml b/audio/claxon/Cargo.toml index 5597bc0a..e96b6d85 100644 --- a/audio/claxon/Cargo.toml +++ b/audio/claxon/Cargo.toml @@ -5,7 +5,8 @@ authors = ["Ruben Gonzalez "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" description = "Claxon FLAC Decoder Plugin" -edition = "2018" +edition = "2021" +rust-version = "1.56" [dependencies] gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } diff --git a/audio/csound/Cargo.toml b/audio/csound/Cargo.toml index 6d2d9e6c..7f61a02a 100644 --- a/audio/csound/Cargo.toml +++ b/audio/csound/Cargo.toml @@ -4,7 +4,8 @@ version = "0.8.0" authors = ["Natanael Mojica "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "LGPL-2.1-or-later" -edition = "2018" +edition = "2021" +rust-version = "1.56" description = "An Audio filter plugin based on Csound" [dependencies] diff --git a/audio/lewton/Cargo.toml b/audio/lewton/Cargo.toml index d31b25f1..22d0f32e 100644 --- a/audio/lewton/Cargo.toml +++ b/audio/lewton/Cargo.toml @@ -5,7 +5,8 @@ authors = ["Sebastian Dröge "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" description = "lewton Vorbis Decoder Plugin" -edition = "2018" +edition = "2021" +rust-version = "1.56" [dependencies] gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } diff --git a/ci/install-rust-ext.sh b/ci/install-rust-ext.sh index d3cd198a..c92f06e3 100755 --- a/ci/install-rust-ext.sh +++ b/ci/install-rust-ext.sh @@ -3,5 +3,4 @@ source ./ci/env.sh set -e export CARGO_HOME='/usr/local/cargo' -# Install 0.9.4 until Rust 1.56 is the minimum supported version here -cargo install cargo-c --version 0.9.4+cargo-0.56 +cargo install cargo-c --version 0.9.5+cargo-0.57 diff --git a/generic/file/Cargo.toml b/generic/file/Cargo.toml index c6371f9d..72d2f891 100644 --- a/generic/file/Cargo.toml +++ b/generic/file/Cargo.toml @@ -5,7 +5,8 @@ authors = ["Sebastian Dröge "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" description = "Rust File Plugin" -edition = "2018" +edition = "2021" +rust-version = "1.56" [dependencies] url = "2" diff --git a/generic/file/src/file_location.rs b/generic/file/src/file_location.rs index 8d567228..5081c966 100644 --- a/generic/file/src/file_location.rs +++ b/generic/file/src/file_location.rs @@ -1,7 +1,6 @@ use gst::glib; use url::Url; -use std::convert::AsRef; use std::fmt; use std::ops::Deref; use std::path::{Path, PathBuf}; diff --git a/generic/sodium/Cargo.toml b/generic/sodium/Cargo.toml index 2949ef75..ac424e54 100644 --- a/generic/sodium/Cargo.toml +++ b/generic/sodium/Cargo.toml @@ -5,7 +5,8 @@ authors = ["Jordan Petridis "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" description = "libsodium-based file encryption and decryption" license = "MIT" -edition = "2018" +edition = "2021" +rust-version = "1.56" [dependencies] gst = { package="gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } diff --git a/generic/sodium/src/decrypter/imp.rs b/generic/sodium/src/decrypter/imp.rs index 286a87b1..8c5d2754 100644 --- a/generic/sodium/src/decrypter/imp.rs +++ b/generic/sodium/src/decrypter/imp.rs @@ -306,8 +306,6 @@ impl Decrypter { true } QueryView::Duration(ref mut q) => { - use std::convert::TryInto; - if q.format() != gst::Format::Bytes { return pad.query_default(Some(element), query); } diff --git a/generic/sodium/src/encrypter/imp.rs b/generic/sodium/src/encrypter/imp.rs index e81e0c78..5ae2e188 100644 --- a/generic/sodium/src/encrypter/imp.rs +++ b/generic/sodium/src/encrypter/imp.rs @@ -284,8 +284,6 @@ impl Encrypter { true } QueryView::Duration(ref mut q) => { - use std::convert::TryInto; - if q.format() != gst::Format::Bytes { return pad.query_default(Some(element), query); } diff --git a/generic/threadshare/Cargo.toml b/generic/threadshare/Cargo.toml index 24885eaf..11906c78 100644 --- a/generic/threadshare/Cargo.toml +++ b/generic/threadshare/Cargo.toml @@ -5,7 +5,8 @@ authors = ["Sebastian Dröge "] license = "LGPL-2.1-or-later" description = "Threadshare Plugin" repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" -edition = "2018" +edition = "2021" +rust-version = "1.56" [dependencies] libc = "0.2" diff --git a/generic/threadshare/src/appsrc/imp.rs b/generic/threadshare/src/appsrc/imp.rs index 2c42a1bf..3e62421d 100644 --- a/generic/threadshare/src/appsrc/imp.rs +++ b/generic/threadshare/src/appsrc/imp.rs @@ -28,7 +28,6 @@ use gst::{gst_debug, gst_error, gst_log, gst_trace}; use once_cell::sync::Lazy; -use std::convert::TryInto; use std::sync::Arc; use std::sync::Mutex as StdMutex; use std::time::Duration; diff --git a/generic/threadshare/src/udpsink/imp.rs b/generic/threadshare/src/udpsink/imp.rs index edf911c7..18f7e085 100644 --- a/generic/threadshare/src/udpsink/imp.rs +++ b/generic/threadshare/src/udpsink/imp.rs @@ -34,10 +34,8 @@ use crate::runtime::prelude::*; use crate::runtime::{self, Context, PadSink, PadSinkRef, Task}; use crate::socket::{wrap_socket, GioSocketWrapper}; -use std::convert::TryInto; use std::mem; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; -use std::string::ToString; use std::sync::Mutex as StdMutex; use std::sync::{Arc, RwLock}; use std::time::Duration; diff --git a/net/reqwest/Cargo.toml b/net/reqwest/Cargo.toml index b57cffec..88bf38c4 100644 --- a/net/reqwest/Cargo.toml +++ b/net/reqwest/Cargo.toml @@ -5,7 +5,8 @@ authors = ["Sebastian Dröge "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" description = "Rust HTTP Plugin" -edition = "2018" +edition = "2021" +rust-version = "1.56" [dependencies] url = "2.1" diff --git a/net/reqwest/src/reqwesthttpsrc/imp.rs b/net/reqwest/src/reqwesthttpsrc/imp.rs index a65ae5a8..7025abbe 100644 --- a/net/reqwest/src/reqwesthttpsrc/imp.rs +++ b/net/reqwest/src/reqwesthttpsrc/imp.rs @@ -341,7 +341,6 @@ impl ReqwestHttpSrc { ) -> Result> { use headers::{Connection, ContentLength, ContentRange, HeaderMapExt, Range, UserAgent}; use reqwest::header::{self, HeaderMap, HeaderName, HeaderValue}; - use std::str::FromStr; gst_debug!(CAT, obj: src, "Creating new request for {}", uri); @@ -371,19 +370,17 @@ impl ReqwestHttpSrc { } } - headers.typed_insert(UserAgent::from_str(&settings.user_agent).unwrap()); + headers.typed_insert(settings.user_agent.parse::().unwrap()); if !settings.compress { // Compression is the default headers.insert( header::ACCEPT_ENCODING, - HeaderValue::from_str("identity").unwrap(), + "identity".parse::().unwrap(), ); }; if let Some(ref extra_headers) = settings.extra_headers { - use std::convert::TryFrom; - for (field, value) in extra_headers.iter() { let field = match HeaderName::try_from(field) { Ok(field) => field, @@ -416,7 +413,7 @@ impl ReqwestHttpSrc { let value = value.get::>().unwrap().unwrap_or(""); - let value = match HeaderValue::from_str(value) { + let value = match value.parse::() { Ok(value) => value, Err(_) => { gst_warning!( @@ -449,7 +446,7 @@ impl ReqwestHttpSrc { if !settings.cookies.is_empty() { headers.insert( header::COOKIE, - HeaderValue::from_str(&settings.cookies.join("; ")).unwrap(), + settings.cookies.join("; ").parse::().unwrap(), ); } @@ -562,7 +559,7 @@ impl ReqwestHttpSrc { if let Some(content_type) = headers .get(header::CONTENT_TYPE) .and_then(|content_type| content_type.to_str().ok()) - .and_then(|content_type| mime::Mime::from_str(content_type).ok()) + .and_then(|content_type| content_type.parse::().ok()) { gst_debug!(CAT, obj: src, "Got content type {}", content_type); if let Some(ref mut caps) = caps { diff --git a/net/rusoto/Cargo.toml b/net/rusoto/Cargo.toml index 67f9e736..d44f83b5 100644 --- a/net/rusoto/Cargo.toml +++ b/net/rusoto/Cargo.toml @@ -7,7 +7,8 @@ authors = ["Arun Raghavan ", repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" description = "Amazon Web Services plugin" -edition = "2018" +edition = "2021" +rust-version = "1.56" [dependencies] bytes = "1.0" diff --git a/net/rusoto/src/s3sink/imp.rs b/net/rusoto/src/s3sink/imp.rs index 90b9f90f..63c42569 100644 --- a/net/rusoto/src/s3sink/imp.rs +++ b/net/rusoto/src/s3sink/imp.rs @@ -23,8 +23,6 @@ use rusoto_s3::{ use once_cell::sync::Lazy; -use std::convert::From; -use std::str::FromStr; use std::sync::Mutex; use crate::s3url::*; @@ -521,7 +519,8 @@ impl ObjectImpl for S3Sink { } "region" => { let region = value.get::().expect("type checked upstream"); - settings.region = Region::from_str(®ion) + settings.region = region + .parse::() .or_else(|_| { let (name, endpoint) = region.split_once('+').ok_or(())?; Ok(Region::Custom { diff --git a/net/rusoto/src/s3url.rs b/net/rusoto/src/s3url.rs index b5e59ef6..f9d728d5 100644 --- a/net/rusoto/src/s3url.rs +++ b/net/rusoto/src/s3url.rs @@ -6,8 +6,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::str::FromStr; - use percent_encoding::{percent_decode, percent_encode, AsciiSet, CONTROLS}; use rusoto_core::Region; use url::Url; @@ -75,7 +73,8 @@ pub fn parse_s3_url(url_str: &str) -> Result { } let host = url.host_str().unwrap(); - let region = Region::from_str(host) + let region = host + .parse::() .or_else(|_| { let (name, endpoint) = host.split_once('+').ok_or(())?; let name = diff --git a/text/json/Cargo.toml b/text/json/Cargo.toml index 8107327b..e57b9aaa 100644 --- a/text/json/Cargo.toml +++ b/text/json/Cargo.toml @@ -3,7 +3,8 @@ name = "gst-plugin-json" version = "0.8.0" authors = ["Mathieu Duponchelle "] license = "LGPL-2.1-or-later" -edition = "2018" +edition = "2021" +rust-version = "1.56" description = "Rust JSON Plugin" repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" diff --git a/text/json/src/jsongstparse/imp.rs b/text/json/src/jsongstparse/imp.rs index 084deeda..76cb16dd 100644 --- a/text/json/src/jsongstparse/imp.rs +++ b/text/json/src/jsongstparse/imp.rs @@ -23,7 +23,6 @@ use gst::{gst_debug, gst_error, gst_info, gst_log, gst_trace, gst_warning}; use once_cell::sync::Lazy; use std::cmp; -use std::convert::TryInto; use std::sync::{Mutex, MutexGuard}; use serde::Deserialize; diff --git a/text/regex/Cargo.toml b/text/regex/Cargo.toml index 8191646f..2d5e753f 100644 --- a/text/regex/Cargo.toml +++ b/text/regex/Cargo.toml @@ -3,7 +3,8 @@ name = "gst-plugin-regex" version = "0.8.0" authors = ["Mathieu Duponchelle "] license = "LGPL-2.1-or-later" -edition = "2018" +edition = "2021" +rust-version = "1.56" description = "Rust Regular Expression Plugin" repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" diff --git a/text/wrap/Cargo.toml b/text/wrap/Cargo.toml index 0b625443..762568d2 100644 --- a/text/wrap/Cargo.toml +++ b/text/wrap/Cargo.toml @@ -3,7 +3,8 @@ name = "gst-plugin-textwrap" version = "0.8.0" authors = ["Mathieu Duponchelle "] license = "LGPL-2.1-or-later" -edition = "2018" +edition = "2021" +rust-version = "1.56" description = "Rust Text Wrap Plugin" repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" diff --git a/tutorial/Cargo.toml b/tutorial/Cargo.toml index 9877730c..0f00a68c 100644 --- a/tutorial/Cargo.toml +++ b/tutorial/Cargo.toml @@ -4,7 +4,8 @@ version = "0.8.0" authors = ["Sebastian Dröge "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" -edition = "2018" +edition = "2021" +rust-version = "1.56" description = "Rust Tutorial Plugin" [dependencies] diff --git a/utils/fallbackswitch/Cargo.toml b/utils/fallbackswitch/Cargo.toml index 6f40aea8..f4b8bd7d 100644 --- a/utils/fallbackswitch/Cargo.toml +++ b/utils/fallbackswitch/Cargo.toml @@ -4,7 +4,8 @@ version = "0.8.0" authors = ["Sebastian Dröge "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "LGPL-2.1-or-later" -edition = "2018" +edition = "2021" +rust-version = "1.56" description = "Fallback Switcher Plugin" [dependencies] diff --git a/utils/fallbackswitch/src/fallbacksrc/imp.rs b/utils/fallbackswitch/src/fallbacksrc/imp.rs index 14111b4c..e43cc10b 100644 --- a/utils/fallbackswitch/src/fallbacksrc/imp.rs +++ b/utils/fallbackswitch/src/fallbacksrc/imp.rs @@ -20,7 +20,6 @@ use gst::prelude::*; use gst::subclass::prelude::*; use gst::{gst_debug, gst_error, gst_info, gst_warning}; -use std::convert::TryFrom; use std::mem; use std::sync::Mutex; use std::time::Instant; diff --git a/utils/togglerecord/Cargo.toml b/utils/togglerecord/Cargo.toml index caddfee0..43eac982 100644 --- a/utils/togglerecord/Cargo.toml +++ b/utils/togglerecord/Cargo.toml @@ -5,7 +5,8 @@ authors = ["Sebastian Dröge "] license = "LGPL-2.1-or-later" description = "Toggle Record Plugin" repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" -edition = "2018" +edition = "2021" +rust-version = "1.56" [dependencies] gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } diff --git a/version-helper/Cargo.toml b/version-helper/Cargo.toml index 88069022..b8662b39 100644 --- a/version-helper/Cargo.toml +++ b/version-helper/Cargo.toml @@ -9,7 +9,8 @@ repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT" homepage = "https://gstreamer.freedesktop.org" keywords = ["gstreamer", "multimedia", "cargo"] -edition = "2018" +edition = "2021" +rust-version = "1.56" [dependencies] chrono = "0.4.6" diff --git a/version-helper/src/lib.rs b/version-helper/src/lib.rs index 753af786..a9abe1bb 100644 --- a/version-helper/src/lib.rs +++ b/version-helper/src/lib.rs @@ -33,7 +33,6 @@ mod git; use chrono::TimeZone; -use std::convert::TryInto; use std::time::SystemTime; use std::{env, fs, path}; diff --git a/video/cdg/Cargo.toml b/video/cdg/Cargo.toml index 887d8ec9..b522c7fe 100644 --- a/video/cdg/Cargo.toml +++ b/video/cdg/Cargo.toml @@ -5,7 +5,8 @@ authors = ["Guillaume Desmottes "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" description = "CDG Plugin" -edition = "2018" +edition = "2021" +rust-version = "1.56" [dependencies] gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_12"] } diff --git a/video/cdg/src/cdgparse/imp.rs b/video/cdg/src/cdgparse/imp.rs index 11cd3fc5..ab02f56a 100644 --- a/video/cdg/src/cdgparse/imp.rs +++ b/video/cdg/src/cdgparse/imp.rs @@ -13,7 +13,6 @@ use gst::subclass::prelude::*; use gst_base::prelude::*; use gst_base::subclass::prelude::*; use once_cell::sync::Lazy; -use std::convert::TryInto; use crate::constants::{ CDG_COMMAND, CDG_HEIGHT, CDG_MASK, CDG_PACKET_PERIOD, CDG_PACKET_SIZE, CDG_WIDTH, diff --git a/video/closedcaption/Cargo.toml b/video/closedcaption/Cargo.toml index a31fe8e9..be60055b 100644 --- a/video/closedcaption/Cargo.toml +++ b/video/closedcaption/Cargo.toml @@ -3,7 +3,8 @@ name = "gst-plugin-closedcaption" version = "0.8.0" authors = ["Sebastian Dröge ", "Jordan Petridis ", "Matthew Waters "] license = "LGPL-2.1-or-later" -edition = "2018" +edition = "2021" +rust-version = "1.56" description = "Rust Closed Caption Plugin" repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" diff --git a/video/closedcaption/src/mcc_parse/imp.rs b/video/closedcaption/src/mcc_parse/imp.rs index 4edd08ab..3dac9a9f 100644 --- a/video/closedcaption/src/mcc_parse/imp.rs +++ b/video/closedcaption/src/mcc_parse/imp.rs @@ -25,7 +25,6 @@ use gst::{ use gst_video::ValidVideoTimeCode; use std::cmp; -use std::convert::TryInto; use std::sync::{Mutex, MutexGuard}; use once_cell::sync::Lazy; diff --git a/video/closedcaption/src/scc_parse/imp.rs b/video/closedcaption/src/scc_parse/imp.rs index e3207d28..09b7bbe1 100644 --- a/video/closedcaption/src/scc_parse/imp.rs +++ b/video/closedcaption/src/scc_parse/imp.rs @@ -25,7 +25,6 @@ use gst::{ }; use std::cmp; -use std::convert::TryInto; use std::sync::{Mutex, MutexGuard}; use once_cell::sync::Lazy; @@ -106,8 +105,6 @@ fn parse_timecode( framerate: gst::Fraction, tc: &TimeCode, ) -> Result { - use std::convert::TryFrom; - let mut tc = tc.clone(); // Workaround for various SCC files having invalid drop frame timecodes: // Every full minute the first two timecodes are skipped, except for every tenth minute. diff --git a/video/closedcaption/tests/scc_parse.rs b/video/closedcaption/tests/scc_parse.rs index 404de9d4..3f729cb4 100644 --- a/video/closedcaption/tests/scc_parse.rs +++ b/video/closedcaption/tests/scc_parse.rs @@ -113,9 +113,6 @@ fn test_parse() { /// Test that ensures timecode parsing is the expected one #[test] fn test_timecodes() { - use std::convert::TryInto; - use std::str::FromStr; - init(); let data = include_bytes!("timecodes-cut-down-sample.scc").as_ref(); @@ -147,7 +144,7 @@ fn test_timecodes() { let mut valid_timecodes: VecDeque = timecodes .iter() .map(|s| { - let mut t = VideoTimeCode::from_str(s).unwrap(); + let mut t = s.parse::().unwrap(); t.set_fps(gst::Fraction::new(30000, 1001)); t.set_flags(gst_video::VideoTimeCodeFlags::DROP_FRAME); t diff --git a/video/dav1d/Cargo.toml b/video/dav1d/Cargo.toml index 2af31076..de17ebc8 100644 --- a/video/dav1d/Cargo.toml +++ b/video/dav1d/Cargo.toml @@ -2,7 +2,8 @@ name = "gst-plugin-dav1d" version = "0.8.0" authors = ["Philippe Normand "] -edition = "2018" +edition = "2021" +rust-version = "1.56" repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" description = "Dav1d Plugin" diff --git a/video/dav1d/src/dav1ddec/imp.rs b/video/dav1d/src/dav1ddec/imp.rs index 4cfe4aa6..b73d168a 100644 --- a/video/dav1d/src/dav1ddec/imp.rs +++ b/video/dav1d/src/dav1ddec/imp.rs @@ -15,9 +15,7 @@ use gst_video::subclass::prelude::*; use once_cell::sync::Lazy; -use std::convert::TryInto; use std::i32; -use std::str::FromStr; use std::sync::Mutex; #[derive(Default)] @@ -80,7 +78,7 @@ impl Dav1dDec { None => format_desc.into(), } }; - gst_video::VideoFormat::from_str(&f).unwrap_or_else(|_| { + f.parse::().unwrap_or_else(|_| { gst_warning!(CAT, "Unsupported dav1d format: {}", f); gst_video::VideoFormat::Unknown }) diff --git a/video/ffv1/Cargo.toml b/video/ffv1/Cargo.toml index 8066d821..4f8731bd 100644 --- a/video/ffv1/Cargo.toml +++ b/video/ffv1/Cargo.toml @@ -5,7 +5,8 @@ authors = ["Arun Raghavan "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" description = "FFV1 Decoder Plugin" -edition = "2018" +edition = "2021" +rust-version = "1.56" [dependencies] byte-slice-cast = "1" diff --git a/video/flavors/Cargo.toml b/video/flavors/Cargo.toml index 39eb28c3..2201d895 100644 --- a/video/flavors/Cargo.toml +++ b/video/flavors/Cargo.toml @@ -4,7 +4,8 @@ version = "0.8.0" authors = ["Sebastian Dröge "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" -edition = "2018" +edition = "2021" +rust-version = "1.56" description = "Rust FLV Plugin" [dependencies] diff --git a/video/gif/Cargo.toml b/video/gif/Cargo.toml index 1daa86f4..233244c6 100644 --- a/video/gif/Cargo.toml +++ b/video/gif/Cargo.toml @@ -4,7 +4,8 @@ version = "0.8.0" authors = ["Markus Ebner "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" -edition = "2018" +edition = "2021" +rust-version = "1.56" description = "GStreamer GIF plugin" [dependencies] diff --git a/video/gtk4/Cargo.toml b/video/gtk4/Cargo.toml index 9d1dbad3..5c9a5502 100644 --- a/video/gtk4/Cargo.toml +++ b/video/gtk4/Cargo.toml @@ -4,7 +4,8 @@ version = "0.1.0" authors = ["Bilal Elmoussaoui ", "Jordan Petridis ", "Sebastian Dröge "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MPL-2.0" -edition = "2018" +edition = "2021" +rust-version = "1.56" description = "GTK 4 Sink element and Paintable widget" [dependencies] diff --git a/video/gtk4/src/sink/frame.rs b/video/gtk4/src/sink/frame.rs index 5fe11b18..1ea5a749 100644 --- a/video/gtk4/src/sink/frame.rs +++ b/video/gtk4/src/sink/frame.rs @@ -12,7 +12,6 @@ use gtk::prelude::*; use gtk::{gdk, glib}; use std::collections::{HashMap, HashSet}; -use std::convert::AsRef; #[derive(Debug)] pub struct Frame { diff --git a/video/hsv/Cargo.toml b/video/hsv/Cargo.toml index 4ba79dec..7522cd78 100644 --- a/video/hsv/Cargo.toml +++ b/video/hsv/Cargo.toml @@ -4,7 +4,8 @@ version = "0.8.0" authors = ["Julien Bardagi "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" -edition = "2018" +edition = "2021" +rust-version = "1.56" description = "HSV manipulation elements, written in Rust" [dependencies] diff --git a/video/hsv/src/hsvdetector/imp.rs b/video/hsv/src/hsvdetector/imp.rs index e729d07d..8a1f3a39 100644 --- a/video/hsv/src/hsvdetector/imp.rs +++ b/video/hsv/src/hsvdetector/imp.rs @@ -18,7 +18,6 @@ use std::i32; use std::sync::Mutex; use once_cell::sync::Lazy; -use std::convert::TryInto; use super::super::hsvutils; diff --git a/video/hsv/src/hsvfilter/imp.rs b/video/hsv/src/hsvfilter/imp.rs index 0cb8f457..61071de8 100644 --- a/video/hsv/src/hsvfilter/imp.rs +++ b/video/hsv/src/hsvfilter/imp.rs @@ -17,7 +17,6 @@ use std::i32; use std::sync::Mutex; use once_cell::sync::Lazy; -use std::convert::TryInto; use super::super::hsvutils; diff --git a/video/rav1e/Cargo.toml b/video/rav1e/Cargo.toml index f6cd7121..32d11613 100644 --- a/video/rav1e/Cargo.toml +++ b/video/rav1e/Cargo.toml @@ -5,7 +5,8 @@ authors = ["Sebastian Dröge "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" description = "rav1e AV1 Encoder Plugin" -edition = "2018" +edition = "2021" +rust-version = "1.56" [dependencies] gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } diff --git a/video/rspng/Cargo.toml b/video/rspng/Cargo.toml index dfbd01b8..710fc109 100644 --- a/video/rspng/Cargo.toml +++ b/video/rspng/Cargo.toml @@ -4,7 +4,8 @@ version = "0.8.0" authors = ["Natanael Mojica "] repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs" license = "MIT/Apache-2.0" -edition = "2018" +edition = "2021" +rust-version = "1.56" description = "An PNG encoder/decoder written in pure Rust" [dependencies] diff --git a/video/webp/Cargo.toml b/video/webp/Cargo.toml index 420719e1..f27aadb5 100644 --- a/video/webp/Cargo.toml +++ b/video/webp/Cargo.toml @@ -3,7 +3,8 @@ name = "gst-plugin-webp" version = "0.8.0" authors = ["Mathieu Duponchelle "] license = "LGPL-2.1-or-later" -edition = "2018" +edition = "2021" +rust-version = "1.56" description = "WebP Plugin" repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"