Loading crates/s3s/Cargo.toml +2 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [features] default = ["check-bucket-name"] check-bucket-name = [] openssl = ["dep:openssl"] [target.'cfg(not(windows))'.dependencies] Loading crates/s3s/src/path.rs +6 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ //! + [Bucket naming rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html) use std::net::IpAddr; use std::ops::Not as _; /// A path in the S3 storage #[derive(Debug, PartialEq, Eq)] Loading Loading @@ -108,9 +109,13 @@ impl S3Path { } /// See [bucket naming rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html) #[allow(clippy::manual_is_variant_and)] // FIXME: https://github.com/rust-lang/rust-clippy/issues/15202 #[allow(clippy::manual_is_variant_and)] #[must_use] pub fn check_bucket_name(name: &str) -> bool { if cfg!(not(feature = "check-bucket-name")) { return name.is_empty().not(); } if !(3_usize..64).contains(&name.len()) { return false; } Loading Loading
crates/s3s/Cargo.toml +2 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [features] default = ["check-bucket-name"] check-bucket-name = [] openssl = ["dep:openssl"] [target.'cfg(not(windows))'.dependencies] Loading
crates/s3s/src/path.rs +6 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ //! + [Bucket naming rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html) use std::net::IpAddr; use std::ops::Not as _; /// A path in the S3 storage #[derive(Debug, PartialEq, Eq)] Loading Loading @@ -108,9 +109,13 @@ impl S3Path { } /// See [bucket naming rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html) #[allow(clippy::manual_is_variant_and)] // FIXME: https://github.com/rust-lang/rust-clippy/issues/15202 #[allow(clippy::manual_is_variant_and)] #[must_use] pub fn check_bucket_name(name: &str) -> bool { if cfg!(not(feature = "check-bucket-name")) { return name.is_empty().not(); } if !(3_usize..64).contains(&name.len()) { return false; } Loading