Commit 0399dbd5 authored by Nugine's avatar Nugine
Browse files

Revert "feat(s3s): check_bucket_name as default optional feature"

This reverts commit fe36af8d.
parent 6030b94a
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["check-bucket-name"]
check-bucket-name = []
openssl = ["dep:openssl"]
minio = []

+1 −6
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@
//! + [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)]
@@ -109,13 +108,9 @@ impl S3Path {
}

/// See [bucket naming rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html)
#[allow(clippy::manual_is_variant_and)]
#[allow(clippy::manual_is_variant_and)] // FIXME: https://github.com/rust-lang/rust-clippy/issues/15202
#[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;
    }