Use write! instead of format! to pacify clippy
This commit is contained in:
parent
9c20a06068
commit
9d9773bd2a
|
@ -3011,7 +3011,8 @@ fn main() {
|
||||||
if detail.skipped_reasons.is_empty() {
|
if detail.skipped_reasons.is_empty() {
|
||||||
detail.skipped_reasons = format!("{:?}", skipped_reason);
|
detail.skipped_reasons = format!("{:?}", skipped_reason);
|
||||||
} else {
|
} else {
|
||||||
detail.skipped_reasons += &format!("/{:?}", skipped_reason);
|
use std::fmt::Write;
|
||||||
|
let _ = write!(&mut detail.skipped_reasons, "/{:?}", skipped_reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ use {
|
||||||
cmp,
|
cmp,
|
||||||
collections::{hash_map::Entry as HashMapEntry, BTreeSet, HashMap, HashSet},
|
collections::{hash_map::Entry as HashMapEntry, BTreeSet, HashMap, HashSet},
|
||||||
convert::TryInto,
|
convert::TryInto,
|
||||||
|
fmt::Write,
|
||||||
fs,
|
fs,
|
||||||
io::{Error as IoError, ErrorKind},
|
io::{Error as IoError, ErrorKind},
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
|
@ -3869,27 +3870,33 @@ pub fn create_new_ledger(
|
||||||
ledger_path.join(format!("{}.failed", DEFAULT_GENESIS_ARCHIVE)),
|
ledger_path.join(format!("{}.failed", DEFAULT_GENESIS_ARCHIVE)),
|
||||||
)
|
)
|
||||||
.unwrap_or_else(|e| {
|
.unwrap_or_else(|e| {
|
||||||
error_messages += &format!(
|
let _ = write!(
|
||||||
|
&mut error_messages,
|
||||||
"/failed to stash problematic {}: {}",
|
"/failed to stash problematic {}: {}",
|
||||||
DEFAULT_GENESIS_ARCHIVE, e
|
DEFAULT_GENESIS_ARCHIVE, e
|
||||||
)
|
);
|
||||||
});
|
});
|
||||||
fs::rename(
|
fs::rename(
|
||||||
&ledger_path.join(DEFAULT_GENESIS_FILE),
|
&ledger_path.join(DEFAULT_GENESIS_FILE),
|
||||||
ledger_path.join(format!("{}.failed", DEFAULT_GENESIS_FILE)),
|
ledger_path.join(format!("{}.failed", DEFAULT_GENESIS_FILE)),
|
||||||
)
|
)
|
||||||
.unwrap_or_else(|e| {
|
.unwrap_or_else(|e| {
|
||||||
error_messages += &format!(
|
let _ = write!(
|
||||||
|
&mut error_messages,
|
||||||
"/failed to stash problematic {}: {}",
|
"/failed to stash problematic {}: {}",
|
||||||
DEFAULT_GENESIS_FILE, e
|
DEFAULT_GENESIS_FILE, e
|
||||||
)
|
);
|
||||||
});
|
});
|
||||||
fs::rename(
|
fs::rename(
|
||||||
&ledger_path.join(blockstore_dir),
|
&ledger_path.join(blockstore_dir),
|
||||||
ledger_path.join(format!("{}.failed", blockstore_dir)),
|
ledger_path.join(format!("{}.failed", blockstore_dir)),
|
||||||
)
|
)
|
||||||
.unwrap_or_else(|e| {
|
.unwrap_or_else(|e| {
|
||||||
error_messages += &format!("/failed to stash problematic {}: {}", blockstore_dir, e)
|
let _ = write!(
|
||||||
|
&mut error_messages,
|
||||||
|
"/failed to stash problematic {}: {}",
|
||||||
|
blockstore_dir, e
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
return Err(BlockstoreError::Io(IoError::new(
|
return Err(BlockstoreError::Io(IoError::new(
|
||||||
|
|
Loading…
Reference in New Issue