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

chore: apply clippy lints #402

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions s3/src/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2876,7 +2876,7 @@ mod test {
)]
async fn test_tagging_aws() {
let bucket = test_aws_bucket();
let _target_tags = vec![
let _target_tags = [
Tag {
key: "Tag1".to_string(),
value: "Value1".to_string(),
Expand Down Expand Up @@ -2917,7 +2917,7 @@ mod test {
)]
async fn test_tagging_minio() {
let bucket = test_minio_bucket();
let _target_tags = vec![
let _target_tags = [
Tag {
key: "Tag1".to_string(),
value: "Value1".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion s3/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ pub enum Command<'a> {
},
}

impl<'a> Command<'a> {
impl Command<'_> {
pub fn http_verb(&self) -> HttpMethod {
match *self {
Command::GetObject
Expand Down
2 changes: 1 addition & 1 deletion s3/src/request/tokio_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub struct ReqwestRequest<'a> {
}

#[maybe_async]
impl<'a> Request for ReqwestRequest<'a> {
impl Request for ReqwestRequest<'_> {
type Response = reqwest::Response;
type HeaderMap = reqwest::header::HeaderMap;

Expand Down
7 changes: 4 additions & 3 deletions s3/src/utils/time_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ pub fn now_utc() -> OffsetDateTime {
OffsetDateTime::from_unix_timestamp(current_time().unwrap() as i64).unwrap()
}

#[cfg(test)]
pub use mocked_time::*;

#[cfg(test)]
mod mocked_time {
use super::*;

use std::cell::Cell;

thread_local! {
static TIMESTAMP: Cell<u64> = Cell::new(0);
static TIMESTAMP: Cell<u64> = const { Cell::new(0) };
}

pub fn current_time() -> Result<u64, SystemTimeError> {
Expand Down Expand Up @@ -157,5 +160,3 @@ mod mocked_time {
}
}
}
#[cfg(test)]
pub use mocked_time::*;
Loading