mirror of
https://github.com/rustfs/rustfs.git
synced 2026-01-17 09:40:32 +00:00
Merge pull request #456 from rustfs/fix/spelling-errors
fix: correct spelling errors in codebase
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -114,13 +114,13 @@ pub fn find_ellipses_patterns(arg: &str) -> Result<ArgPattern> {
|
||||
}
|
||||
};
|
||||
|
||||
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<ArgPattern> {
|
||||
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<ArgPattern> {
|
||||
// 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<ArgPattern> {
|
||||
}
|
||||
}
|
||||
|
||||
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<Vec<String>> {
|
||||
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"));
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user