From dcdf7b1ac931347a14f61419be4a4ecfbc19808a Mon Sep 17 00:00:00 2001 From: Carter Green Date: Tue, 3 Dec 2024 10:33:42 -0600 Subject: [PATCH] BLD: Upgrade Rust version to 1.83 --- c/src/decode.rs | 2 +- rust/dbn-cli/tests/integration_tests.rs | 3 ++- rust/dbn/src/decode.rs | 24 ++++++++++++------------ rust/dbn/src/decode/dbn/async.rs | 4 ++-- rust/dbn/src/decode/dbn/sync.rs | 6 +++--- rust/dbn/src/encode/dbn/sync.rs | 2 +- rust/dbn/src/encode/dyn_encoder.rs | 18 +++++++++--------- rust/dbn/src/encode/dyn_writer.rs | 4 ++-- rust/dbn/src/record_enum.rs | 4 ++-- rust/dbn/src/record_ref.rs | 2 +- 10 files changed, 35 insertions(+), 34 deletions(-) diff --git a/c/src/decode.rs b/c/src/decode.rs index 45beb58..af4f9f0 100644 --- a/c/src/decode.rs +++ b/c/src/decode.rs @@ -54,7 +54,7 @@ pub unsafe extern "C" fn DbnDecoder_metadata(decoder: *mut Decoder) -> *const Me #[no_mangle] pub unsafe extern "C" fn DbnDecoder_decode(decoder: *mut Decoder) -> *const RecordHeader { if let Some(Ok(Some(rec))) = decoder.as_mut().map(|d| d.decode_record_ref()) { - return rec.header(); + rec.header() } else { null() } diff --git a/rust/dbn-cli/tests/integration_tests.rs b/rust/dbn-cli/tests/integration_tests.rs index 97b7b43..04a8ad6 100644 --- a/rust/dbn-cli/tests/integration_tests.rs +++ b/rust/dbn-cli/tests/integration_tests.rs @@ -580,11 +580,12 @@ fn broken_pipe_is_silent( if !fragment_flag.is_empty() { dbn_cmd.arg(fragment_flag); } - let dbn_res = dbn_cmd + let mut dbn_res = dbn_cmd .stdout(process::Stdio::piped()) .stderr(process::Stdio::piped()) .spawn() .unwrap(); + dbn_res.wait().unwrap(); let mut false_cmd = process::Command::new("false"); false_cmd.stdin(dbn_res.stdout.unwrap()); Command::from_std(false_cmd) diff --git a/rust/dbn/src/decode.rs b/rust/dbn/src/decode.rs index 6946719..d1ed03f 100644 --- a/rust/dbn/src/decode.rs +++ b/rust/dbn/src/decode.rs @@ -126,7 +126,7 @@ where LegacyDbz(dbz::Decoder), } -impl<'a, R> DynDecoder<'a, BufReader> +impl DynDecoder<'_, BufReader> where R: io::Read, { @@ -156,7 +156,7 @@ where } } -impl<'a, R> DynDecoder<'a, R> +impl DynDecoder<'_, R> where R: io::BufRead, { @@ -223,7 +223,7 @@ where } } -impl<'a> DynDecoder<'a, BufReader> { +impl DynDecoder<'_, BufReader> { /// Creates a new [`DynDecoder`] from the file at `path`. It will decode records /// from previous DBN versions according to `upgrade_policy`. /// @@ -247,7 +247,7 @@ impl<'a> DynDecoder<'a, BufReader> { } } -impl<'a, R> DecodeRecordRef for DynDecoder<'a, R> +impl DecodeRecordRef for DynDecoder<'_, R> where R: io::BufRead, { @@ -261,7 +261,7 @@ where } #[allow(deprecated)] -impl<'a, R> DbnMetadata for DynDecoder<'a, R> +impl DbnMetadata for DynDecoder<'_, R> where R: io::BufRead, { @@ -283,7 +283,7 @@ where } #[allow(deprecated)] -impl<'a, R> DecodeRecord for DynDecoder<'a, R> +impl DecodeRecord for DynDecoder<'_, R> where R: io::BufRead, { @@ -296,7 +296,7 @@ where } } -impl<'a, R> DecodeStream for DynDecoder<'a, R> +impl DecodeStream for DynDecoder<'_, R> where R: io::BufRead, { @@ -322,7 +322,7 @@ where ZStd(::zstd::stream::Decoder<'a, R>), } -impl<'a, R> DynReader<'a, BufReader> +impl DynReader<'_, BufReader> where R: io::Read, { @@ -348,7 +348,7 @@ where } } -impl<'a, R> DynReader<'a, R> +impl DynReader<'_, R> where R: io::BufRead, { @@ -403,7 +403,7 @@ where } } -impl<'a> DynReader<'a, BufReader> { +impl DynReader<'_, BufReader> { /// Creates a new [`DynReader`] from the file at `path`. /// /// # Errors @@ -423,7 +423,7 @@ impl<'a> DynReader<'a, BufReader> { } } -impl<'a, R> io::Read for DynReader<'a, R> +impl io::Read for DynReader<'_, R> where R: io::BufRead, { @@ -435,7 +435,7 @@ where } } -impl<'a, R> private::BufferSlice for DynDecoder<'a, R> +impl private::BufferSlice for DynDecoder<'_, R> where R: io::BufRead, { diff --git a/rust/dbn/src/decode/dbn/async.rs b/rust/dbn/src/decode/dbn/async.rs index 3c75867..c2eedd8 100644 --- a/rust/dbn/src/decode/dbn/async.rs +++ b/rust/dbn/src/decode/dbn/async.rs @@ -111,7 +111,7 @@ where /// # Cancel safety /// This method is cancel safe. It can be used within a `tokio::select!` statement /// without the potential for corrupting the input stream. - pub async fn decode_record<'a, T: HasRType + 'a>(&'a mut self) -> Result> { + pub async fn decode_record<'a, T: HasRType + 'a>(&'a mut self) -> Result> { self.decoder.decode().await } @@ -310,7 +310,7 @@ where /// # Cancel safety /// This method is cancel safe. It can be used within a `tokio::select!` statement /// without the potential for corrupting the input stream. - pub async fn decode<'a, T: HasRType + 'a>(&'a mut self) -> Result> { + pub async fn decode<'a, T: HasRType + 'a>(&'a mut self) -> Result> { let rec_ref = self.decode_ref().await?; if let Some(rec_ref) = rec_ref { rec_ref diff --git a/rust/dbn/src/decode/dbn/sync.rs b/rust/dbn/src/decode/dbn/sync.rs index 20a1af2..ebefcda 100644 --- a/rust/dbn/src/decode/dbn/sync.rs +++ b/rust/dbn/src/decode/dbn/sync.rs @@ -91,7 +91,7 @@ where } } -impl<'a, R> Decoder>> +impl Decoder>> where R: io::Read, { @@ -107,7 +107,7 @@ where } } -impl<'a, R> Decoder> +impl Decoder> where R: io::BufRead, { @@ -140,7 +140,7 @@ impl Decoder> { } } -impl<'a> Decoder>> { +impl Decoder>> { /// Creates a DBN [`Decoder`] from the Zstandard-compressed file at `path`. /// /// # Errors diff --git a/rust/dbn/src/encode/dbn/sync.rs b/rust/dbn/src/encode/dbn/sync.rs index 5edf85a..8fd92ed 100644 --- a/rust/dbn/src/encode/dbn/sync.rs +++ b/rust/dbn/src/encode/dbn/sync.rs @@ -46,7 +46,7 @@ where } } -impl<'a, W> Encoder> +impl Encoder> where W: io::Write, { diff --git a/rust/dbn/src/encode/dyn_encoder.rs b/rust/dbn/src/encode/dyn_encoder.rs index aa13b0b..2e56631 100644 --- a/rust/dbn/src/encode/dyn_encoder.rs +++ b/rust/dbn/src/encode/dyn_encoder.rs @@ -155,7 +155,7 @@ where } } -impl<'a, W> DynEncoder<'a, W> +impl DynEncoder<'_, W> where W: io::Write, { @@ -230,7 +230,7 @@ where } } -impl<'a, W> EncodeRecord for DynEncoder<'a, W> +impl EncodeRecord for DynEncoder<'_, W> where W: io::Write, { @@ -243,7 +243,7 @@ where } } -impl<'a, W> EncodeRecordRef for DynEncoder<'a, W> +impl EncodeRecordRef for DynEncoder<'_, W> where W: io::Write, { @@ -256,7 +256,7 @@ where } } -impl<'a, W> EncodeDbn for DynEncoder<'a, W> +impl EncodeDbn for DynEncoder<'_, W> where W: io::Write, { @@ -276,7 +276,7 @@ where } } -impl<'a, W> EncodeRecordTextExt for DynEncoder<'a, W> +impl EncodeRecordTextExt for DynEncoder<'_, W> where W: io::Write, { @@ -289,7 +289,7 @@ where } } -impl<'a, W> EncodeRecord for DynEncoderImpl<'a, W> +impl EncodeRecord for DynEncoderImpl<'_, W> where W: io::Write, { @@ -310,7 +310,7 @@ where } } -impl<'a, W> EncodeRecordRef for DynEncoderImpl<'a, W> +impl EncodeRecordRef for DynEncoderImpl<'_, W> where W: io::Write, { @@ -331,7 +331,7 @@ where } } -impl<'a, W> EncodeDbn for DynEncoderImpl<'a, W> +impl EncodeDbn for DynEncoderImpl<'_, W> where W: io::Write, { @@ -363,7 +363,7 @@ where } } -impl<'a, W> EncodeRecordTextExt for DynEncoderImpl<'a, W> +impl EncodeRecordTextExt for DynEncoderImpl<'_, W> where W: io::Write, { diff --git a/rust/dbn/src/encode/dyn_writer.rs b/rust/dbn/src/encode/dyn_writer.rs index 8a30590..c8509ca 100644 --- a/rust/dbn/src/encode/dyn_writer.rs +++ b/rust/dbn/src/encode/dyn_writer.rs @@ -17,7 +17,7 @@ where Zstd(zstd::stream::AutoFinishEncoder<'a, W>), } -impl<'a, W> DynWriter<'a, W> +impl DynWriter<'_, W> where W: io::Write, { @@ -41,7 +41,7 @@ where } } -impl<'a, W> io::Write for DynWriter<'a, W> +impl io::Write for DynWriter<'_, W> where W: io::Write, { diff --git a/rust/dbn/src/record_enum.rs b/rust/dbn/src/record_enum.rs index 971f46d..f3dce38 100644 --- a/rust/dbn/src/record_enum.rs +++ b/rust/dbn/src/record_enum.rs @@ -104,7 +104,7 @@ impl<'a> From<&'a RecordEnum> for RecordRefEnum<'a> { } } -impl<'a> RecordRefEnum<'a> { +impl RecordRefEnum<'_> { /// Converts the reference enum into an owned enum value. pub fn to_owned(&self) -> RecordEnum { #[allow(clippy::clone_on_copy)] // required for when trivial_copy feature is disabled @@ -382,7 +382,7 @@ impl RecordMut for RecordEnum { } } -impl<'a> Record for RecordRefEnum<'a> { +impl Record for RecordRefEnum<'_> { fn header(&self) -> &crate::RecordHeader { match self { RecordRefEnum::Mbo(rec) => rec.header(), diff --git a/rust/dbn/src/record_ref.rs b/rust/dbn/src/record_ref.rs index be99f13..df723d1 100644 --- a/rust/dbn/src/record_ref.rs +++ b/rust/dbn/src/record_ref.rs @@ -194,7 +194,7 @@ impl<'a> From> for RecordRef<'a> { } } -impl<'a> Debug for RecordRef<'a> { +impl Debug for RecordRef<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("RecordRef") .field(