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

style: warn and fix more clippy lints #128

Merged
merged 1 commit into from
Dec 31, 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: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,5 @@ pedantic = "warn"
perf = "warn"
style = "warn"
suspicious = "warn"
unused_trait_names = "warn"
ref_patterns = "warn"
2 changes: 1 addition & 1 deletion benches/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::time::Duration;

use criterion::{black_box, criterion_group, criterion_main, Criterion};

use rusty_s3::{Bucket, Credentials, S3Action, UrlStyle};
use rusty_s3::{Bucket, Credentials, S3Action as _, UrlStyle};

fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("Authenticated GetObject", |b| {
Expand Down
2 changes: 1 addition & 1 deletion examples/create_bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::error::Error as StdError;
use std::time::Duration;

use reqwest::Client;
use rusty_s3::actions::{CreateBucket, S3Action};
use rusty_s3::actions::{CreateBucket, S3Action as _};
use rusty_s3::{Bucket, Credentials, UrlStyle};

const ONE_HOUR: Duration = Duration::from_secs(3600);
Expand Down
2 changes: 1 addition & 1 deletion examples/list_objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::error::Error as StdError;
use std::time::Duration;

use reqwest::Client;
use rusty_s3::actions::{ListObjectsV2, S3Action};
use rusty_s3::actions::{ListObjectsV2, S3Action as _};
use rusty_s3::{Bucket, Credentials, UrlStyle};

const ONE_HOUR: Duration = Duration::from_secs(3600);
Expand Down
4 changes: 3 additions & 1 deletion examples/multipart_upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ use std::time::Duration;

use reqwest::header::ETAG;
use reqwest::Client;
use rusty_s3::actions::{CompleteMultipartUpload, CreateMultipartUpload, S3Action, UploadPart};
use rusty_s3::actions::{
CompleteMultipartUpload, CreateMultipartUpload, S3Action as _, UploadPart,
};
use rusty_s3::{Bucket, Credentials, UrlStyle};

const ONE_HOUR: Duration = Duration::from_secs(3600);
Expand Down
2 changes: 1 addition & 1 deletion examples/sign_get.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::time::Duration;

use rusty_s3::actions::{GetObject, S3Action};
use rusty_s3::actions::{GetObject, S3Action as _};
use rusty_s3::{Bucket, Credentials, UrlStyle};

const ONE_HOUR: Duration = Duration::from_secs(3600);
Expand Down
2 changes: 1 addition & 1 deletion examples/sign_put.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::time::Duration;

use rusty_s3::actions::{PutObject, S3Action};
use rusty_s3::actions::{PutObject, S3Action as _};
use rusty_s3::{Bucket, Credentials, UrlStyle};

const ONE_HOUR: Duration = Duration::from_secs(3600);
Expand Down
4 changes: 2 additions & 2 deletions src/actions/delete_objects.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::iter;
use std::time::Duration;

use md5::{Digest, Md5};
use md5::{Digest as _, Md5};
use serde::Serialize;
use time::OffsetDateTime;
use url::Url;
Expand Down Expand Up @@ -100,7 +100,7 @@
.objects
.map(|o| {
let mut nodes = vec![Node::Key(o.key.as_str())];
if let Some(ref version_id) = o.version_id {
if let Some(version_id) = &o.version_id {

Check warning on line 103 in src/actions/delete_objects.rs

View check run for this annotation

Codecov / codecov/patch

src/actions/delete_objects.rs#L103

Added line #L103 was not covered by tests
nodes.push(Node::VersionId(version_id.as_str()));
}
Object { nodes }
Expand Down
2 changes: 1 addition & 1 deletion src/base64.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ::base64::engine::general_purpose::STANDARD;
use ::base64::engine::Engine;
use ::base64::engine::Engine as _;

pub fn encode<T: AsRef<[u8]>>(input: T) -> String {
STANDARD.encode(input)
Expand Down
2 changes: 1 addition & 1 deletion src/credentials/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::mem;

use serde::{Deserialize, Deserializer};
use time::PrimitiveDateTime;
use zeroize::Zeroize;
use zeroize::Zeroize as _;

use crate::time_::ISO8601_EXT;

Expand Down
2 changes: 1 addition & 1 deletion src/signing/signature.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use hmac::{Hmac, Mac};
use hmac::{Hmac, Mac as _};
use sha2::Sha256;
use time::OffsetDateTime;
use zeroize::Zeroizing;
Expand Down
2 changes: 1 addition & 1 deletion src/signing/string_to_sign.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use sha2::{Digest, Sha256};
use sha2::{Digest as _, Sha256};
use time::OffsetDateTime;

use crate::time_::{ISO8601, YYYYMMDD};
Expand Down
2 changes: 1 addition & 1 deletion tests/common.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::time::Duration;

use reqwest::Client;
use rusty_s3::actions::{CreateBucket, S3Action};
use rusty_s3::actions::{CreateBucket, S3Action as _};
use rusty_s3::{Bucket, Credentials, UrlStyle};

pub async fn bucket() -> (Bucket, Credentials, Client) {
Expand Down
2 changes: 1 addition & 1 deletion tests/create_delete_bucket.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::time::Duration;

use rusty_s3::actions::S3Action;
use rusty_s3::actions::S3Action as _;

mod common;

Expand Down
2 changes: 1 addition & 1 deletion tests/delete_objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::time::Duration;
use reqwest::Client;
use url::Url;

use rusty_s3::actions::{ListObjectsV2, ListObjectsV2Response, ObjectIdentifier, S3Action};
use rusty_s3::actions::{ListObjectsV2, ListObjectsV2Response, ObjectIdentifier, S3Action as _};

mod common;

Expand Down
2 changes: 1 addition & 1 deletion tests/list_parts.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use reqwest::Client;
use std::time::Duration;

use rusty_s3::actions::{CreateMultipartUpload, ListParts, ListPartsResponse, S3Action};
use rusty_s3::actions::{CreateMultipartUpload, ListParts, ListPartsResponse, S3Action as _};

mod common;

Expand Down
2 changes: 1 addition & 1 deletion tests/upload_download.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::time::Duration;

use rusty_s3::actions::{ListObjectsV2, S3Action};
use rusty_s3::actions::{ListObjectsV2, S3Action as _};

mod common;

Expand Down
Loading