Skip to content

Commit

Permalink
chore: apply clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
negezor committed Oct 5, 2024
1 parent 7c6fdc0 commit 1cc03e3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
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::*;

0 comments on commit 1cc03e3

Please sign in to comment.