Skip to content

Commit

Permalink
BLD: Upgrade Rust version to 1.83
Browse files Browse the repository at this point in the history
  • Loading branch information
threecgreen committed Dec 4, 2024
1 parent d7d3155 commit dcdf7b1
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion c/src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
3 changes: 2 additions & 1 deletion rust/dbn-cli/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 12 additions & 12 deletions rust/dbn/src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ where
LegacyDbz(dbz::Decoder<R>),
}

impl<'a, R> DynDecoder<'a, BufReader<R>>
impl<R> DynDecoder<'_, BufReader<R>>
where
R: io::Read,
{
Expand Down Expand Up @@ -156,7 +156,7 @@ where
}
}

impl<'a, R> DynDecoder<'a, R>
impl<R> DynDecoder<'_, R>
where
R: io::BufRead,
{
Expand Down Expand Up @@ -223,7 +223,7 @@ where
}
}

impl<'a> DynDecoder<'a, BufReader<File>> {
impl DynDecoder<'_, BufReader<File>> {
/// Creates a new [`DynDecoder`] from the file at `path`. It will decode records
/// from previous DBN versions according to `upgrade_policy`.
///
Expand All @@ -247,7 +247,7 @@ impl<'a> DynDecoder<'a, BufReader<File>> {
}
}

impl<'a, R> DecodeRecordRef for DynDecoder<'a, R>
impl<R> DecodeRecordRef for DynDecoder<'_, R>
where
R: io::BufRead,
{
Expand All @@ -261,7 +261,7 @@ where
}

#[allow(deprecated)]
impl<'a, R> DbnMetadata for DynDecoder<'a, R>
impl<R> DbnMetadata for DynDecoder<'_, R>
where
R: io::BufRead,
{
Expand All @@ -283,7 +283,7 @@ where
}

#[allow(deprecated)]
impl<'a, R> DecodeRecord for DynDecoder<'a, R>
impl<R> DecodeRecord for DynDecoder<'_, R>
where
R: io::BufRead,
{
Expand All @@ -296,7 +296,7 @@ where
}
}

impl<'a, R> DecodeStream for DynDecoder<'a, R>
impl<R> DecodeStream for DynDecoder<'_, R>
where
R: io::BufRead,
{
Expand All @@ -322,7 +322,7 @@ where
ZStd(::zstd::stream::Decoder<'a, R>),
}

impl<'a, R> DynReader<'a, BufReader<R>>
impl<R> DynReader<'_, BufReader<R>>
where
R: io::Read,
{
Expand All @@ -348,7 +348,7 @@ where
}
}

impl<'a, R> DynReader<'a, R>
impl<R> DynReader<'_, R>
where
R: io::BufRead,
{
Expand Down Expand Up @@ -403,7 +403,7 @@ where
}
}

impl<'a> DynReader<'a, BufReader<File>> {
impl DynReader<'_, BufReader<File>> {
/// Creates a new [`DynReader`] from the file at `path`.
///
/// # Errors
Expand All @@ -423,7 +423,7 @@ impl<'a> DynReader<'a, BufReader<File>> {
}
}

impl<'a, R> io::Read for DynReader<'a, R>
impl<R> io::Read for DynReader<'_, R>
where
R: io::BufRead,
{
Expand All @@ -435,7 +435,7 @@ where
}
}

impl<'a, R> private::BufferSlice for DynDecoder<'a, R>
impl<R> private::BufferSlice for DynDecoder<'_, R>
where
R: io::BufRead,
{
Expand Down
4 changes: 2 additions & 2 deletions rust/dbn/src/decode/dbn/async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Option<&T>> {
pub async fn decode_record<'a, T: HasRType + 'a>(&'a mut self) -> Result<Option<&'a T>> {
self.decoder.decode().await
}

Expand Down Expand Up @@ -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<Option<&T>> {
pub async fn decode<'a, T: HasRType + 'a>(&'a mut self) -> Result<Option<&'a T>> {
let rec_ref = self.decode_ref().await?;
if let Some(rec_ref) = rec_ref {
rec_ref
Expand Down
6 changes: 3 additions & 3 deletions rust/dbn/src/decode/dbn/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ where
}
}

impl<'a, R> Decoder<zstd::stream::Decoder<'a, BufReader<R>>>
impl<R> Decoder<zstd::stream::Decoder<'_, BufReader<R>>>
where
R: io::Read,
{
Expand All @@ -107,7 +107,7 @@ where
}
}

impl<'a, R> Decoder<zstd::stream::Decoder<'a, R>>
impl<R> Decoder<zstd::stream::Decoder<'_, R>>
where
R: io::BufRead,
{
Expand Down Expand Up @@ -140,7 +140,7 @@ impl Decoder<BufReader<File>> {
}
}

impl<'a> Decoder<zstd::stream::Decoder<'a, BufReader<File>>> {
impl Decoder<zstd::stream::Decoder<'_, BufReader<File>>> {
/// Creates a DBN [`Decoder`] from the Zstandard-compressed file at `path`.
///
/// # Errors
Expand Down
2 changes: 1 addition & 1 deletion rust/dbn/src/encode/dbn/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ where
}
}

impl<'a, W> Encoder<zstd::stream::AutoFinishEncoder<'a, W>>
impl<W> Encoder<zstd::stream::AutoFinishEncoder<'_, W>>
where
W: io::Write,
{
Expand Down
18 changes: 9 additions & 9 deletions rust/dbn/src/encode/dyn_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ where
}
}

impl<'a, W> DynEncoder<'a, W>
impl<W> DynEncoder<'_, W>
where
W: io::Write,
{
Expand Down Expand Up @@ -230,7 +230,7 @@ where
}
}

impl<'a, W> EncodeRecord for DynEncoder<'a, W>
impl<W> EncodeRecord for DynEncoder<'_, W>
where
W: io::Write,
{
Expand All @@ -243,7 +243,7 @@ where
}
}

impl<'a, W> EncodeRecordRef for DynEncoder<'a, W>
impl<W> EncodeRecordRef for DynEncoder<'_, W>
where
W: io::Write,
{
Expand All @@ -256,7 +256,7 @@ where
}
}

impl<'a, W> EncodeDbn for DynEncoder<'a, W>
impl<W> EncodeDbn for DynEncoder<'_, W>
where
W: io::Write,
{
Expand All @@ -276,7 +276,7 @@ where
}
}

impl<'a, W> EncodeRecordTextExt for DynEncoder<'a, W>
impl<W> EncodeRecordTextExt for DynEncoder<'_, W>
where
W: io::Write,
{
Expand All @@ -289,7 +289,7 @@ where
}
}

impl<'a, W> EncodeRecord for DynEncoderImpl<'a, W>
impl<W> EncodeRecord for DynEncoderImpl<'_, W>
where
W: io::Write,
{
Expand All @@ -310,7 +310,7 @@ where
}
}

impl<'a, W> EncodeRecordRef for DynEncoderImpl<'a, W>
impl<W> EncodeRecordRef for DynEncoderImpl<'_, W>
where
W: io::Write,
{
Expand All @@ -331,7 +331,7 @@ where
}
}

impl<'a, W> EncodeDbn for DynEncoderImpl<'a, W>
impl<W> EncodeDbn for DynEncoderImpl<'_, W>
where
W: io::Write,
{
Expand Down Expand Up @@ -363,7 +363,7 @@ where
}
}

impl<'a, W> EncodeRecordTextExt for DynEncoderImpl<'a, W>
impl<W> EncodeRecordTextExt for DynEncoderImpl<'_, W>
where
W: io::Write,
{
Expand Down
4 changes: 2 additions & 2 deletions rust/dbn/src/encode/dyn_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ where
Zstd(zstd::stream::AutoFinishEncoder<'a, W>),
}

impl<'a, W> DynWriter<'a, W>
impl<W> DynWriter<'_, W>
where
W: io::Write,
{
Expand All @@ -41,7 +41,7 @@ where
}
}

impl<'a, W> io::Write for DynWriter<'a, W>
impl<W> io::Write for DynWriter<'_, W>
where
W: io::Write,
{
Expand Down
4 changes: 2 additions & 2 deletions rust/dbn/src/record_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion rust/dbn/src/record_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl<'a> From<RecordRefEnum<'a>> 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(
Expand Down

0 comments on commit dcdf7b1

Please sign in to comment.