diff --git a/ecstore/src/erasure.rs b/ecstore/src/erasure.rs index 4c61b765..6d2d5883 100644 --- a/ecstore/src/erasure.rs +++ b/ecstore/src/erasure.rs @@ -512,7 +512,7 @@ impl ShardReader { warn!("ec decode read ress {:?}", &ress); warn!("ec decode read errors {:?}", &errors); - return Err(Error::other("shard reader read faild")); + return Err(Error::other("shard reader read failed")); } self.offset += self.shard_size; diff --git a/ecstore/src/store.rs b/ecstore/src/store.rs index 65641885..cf9c11b7 100644 --- a/ecstore/src/store.rs +++ b/ecstore/src/store.rs @@ -241,7 +241,7 @@ impl ECStore { sleep(Duration::from_secs(wait_sec)).await; if exit_count > 10 { - return Err(Error::other("ec init faild")); + return Err(Error::other("ec init failed")); } exit_count += 1; diff --git a/ecstore/src/utils/ellipses.rs b/ecstore/src/utils/ellipses.rs index 9c48b0ed..894303e4 100644 --- a/ecstore/src/utils/ellipses.rs +++ b/ecstore/src/utils/ellipses.rs @@ -114,13 +114,13 @@ pub fn find_ellipses_patterns(arg: &str) -> Result { } }; - let mut pattens = Vec::new(); + let mut patterns = Vec::new(); while let Some(prefix) = parts.get(1) { let seq = parse_ellipses_range(parts[2].into())?; match ELLIPSES_RE.captures(prefix.into()) { Some(cs) => { - pattens.push(Pattern { + patterns.push(Pattern { seq, prefix: String::new(), suffix: parts[3].into(), @@ -128,7 +128,7 @@ pub fn find_ellipses_patterns(arg: &str) -> Result { parts = cs; } None => { - pattens.push(Pattern { + patterns.push(Pattern { seq, prefix: prefix.as_str().to_owned(), suffix: parts[3].into(), @@ -141,7 +141,7 @@ pub fn find_ellipses_patterns(arg: &str) -> Result { // Check if any of the prefix or suffixes now have flower braces // left over, in such a case we generally think that there is // perhaps a typo in users input and error out accordingly. - for p in pattens.iter() { + for p in patterns.iter() { if p.prefix.contains(OPEN_BRACES) || p.prefix.contains(CLOSE_BRACES) || p.suffix.contains(OPEN_BRACES) @@ -154,7 +154,7 @@ pub fn find_ellipses_patterns(arg: &str) -> Result { } } - Ok(ArgPattern::new(pattens)) + Ok(ArgPattern::new(patterns)) } /// returns true if input arg has ellipses type pattern. @@ -173,7 +173,7 @@ pub fn parse_ellipses_range(pattern: &str) -> Result> { if !pattern.contains(OPEN_BRACES) { return Err(Error::other("Invalid argument")); } - if !pattern.contains(OPEN_BRACES) { + if !pattern.contains(CLOSE_BRACES) { return Err(Error::other("Invalid argument")); } diff --git a/rustfs/src/storage/ecfs.rs b/rustfs/src/storage/ecfs.rs index 98f81c6e..6e96df01 100644 --- a/rustfs/src/storage/ecfs.rs +++ b/rustfs/src/storage/ecfs.rs @@ -1508,14 +1508,14 @@ impl S3 for FS { // warn!("input policy {}", &policy); let cfg: BucketPolicy = - serde_json::from_str(&policy).map_err(|e| s3_error!(InvalidArgument, "parse policy faild {:?}", e))?; + serde_json::from_str(&policy).map_err(|e| s3_error!(InvalidArgument, "parse policy failed {:?}", e))?; if let Err(err) = cfg.is_valid() { warn!("put_bucket_policy err input {:?}, {:?}", &policy, err); return Err(s3_error!(InvalidPolicyDocument)); } - let data = serde_json::to_vec(&cfg).map_err(|e| s3_error!(InternalError, "parse policy faild {:?}", e))?; + let data = serde_json::to_vec(&cfg).map_err(|e| s3_error!(InternalError, "parse policy failed {:?}", e))?; metadata_sys::update(&bucket, BUCKET_POLICY_CONFIG, data) .await