Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust 1.82 clippy fixes #6791

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arrow-ord/src/ord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ pub fn make_comparator(
}

#[cfg(test)]
pub mod tests {
mod tests {
use super::*;
use arrow_array::builder::{Int32Builder, ListBuilder};
use arrow_buffer::{i256, IntervalDayTime, OffsetBuffer};
Expand Down
2 changes: 1 addition & 1 deletion object_store/src/aws/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ struct SessionCredential<'a> {
config: &'a S3Config,
}

impl<'a> SessionCredential<'a> {
impl SessionCredential<'_> {
fn authorizer(&self) -> Option<AwsAuthorizer<'_>> {
let mut authorizer =
AwsAuthorizer::new(self.credential.as_deref()?, "s3", &self.config.region)
Expand Down
2 changes: 1 addition & 1 deletion object_store/src/aws/dynamo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ enum ReturnValues {
/// This provides cheap, ordered serialization of maps
struct Map<'a, K, V>(&'a [(K, V)]);

impl<'a, K: Serialize, V: Serialize> Serialize for Map<'a, K, V> {
impl<K: Serialize, V: Serialize> Serialize for Map<'_, K, V> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down
8 changes: 6 additions & 2 deletions object_store/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ fn get_inode(metadata: &Metadata) -> u64 {

#[cfg(not(unix))]
/// On platforms where an inode isn't available, fallback to just relying on size and mtime
fn get_inode(metadata: &Metadata) -> u64 {
fn get_inode(_metadata: &Metadata) -> u64 {
0
}

Expand Down Expand Up @@ -1060,7 +1060,10 @@ mod tests {
use std::fs;

use futures::TryStreamExt;
use tempfile::{NamedTempFile, TempDir};
use tempfile::TempDir;

#[cfg(target_family = "unix")]
use tempfile::NamedTempFile;

use crate::integration::*;

Expand Down Expand Up @@ -1248,6 +1251,7 @@ mod tests {
fs.list_with_delimiter(None).await.unwrap();
}

#[cfg(target_family = "unix")]
async fn check_list(integration: &LocalFileSystem, prefix: Option<&Path>, expected: &[&str]) {
let result: Vec<_> = integration.list(prefix).try_collect().await.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion object_store/src/path/parts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl From<String> for PathPart<'static> {
}
}

impl<'a> AsRef<str> for PathPart<'a> {
impl AsRef<str> for PathPart<'_> {
fn as_ref(&self) -> &str {
self.raw.as_ref()
}
Expand Down
2 changes: 1 addition & 1 deletion parquet/src/arrow/async_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ pub trait AsyncFileReader: Send {
}

/// This allows Box<dyn AsyncFileReader + '_> to be used as an AsyncFileReader,
impl<'reader> AsyncFileReader for Box<dyn AsyncFileReader + 'reader> {
impl AsyncFileReader for Box<dyn AsyncFileReader + '_> {
fn get_bytes(&mut self, range: Range<usize>) -> BoxFuture<'_, Result<Bytes>> {
self.as_mut().get_bytes(range)
}
Expand Down
2 changes: 1 addition & 1 deletion parquet/src/arrow/async_writer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub trait AsyncFileWriter: Send {
fn complete(&mut self) -> BoxFuture<'_, Result<()>>;
}

impl<'writer> AsyncFileWriter for Box<dyn AsyncFileWriter + 'writer> {
impl AsyncFileWriter for Box<dyn AsyncFileWriter + '_> {
fn write(&mut self, bs: Bytes) -> BoxFuture<'_, Result<()>> {
self.as_mut().write(bs)
}
Expand Down
Loading