mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 09:17:58 +00:00
Improve overall performance (#6699)
* Improve overall performance * Clean up code Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Remove needless :: Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Remove needless :: Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -189,7 +189,7 @@ fn check_skip_build() -> bool {
|
||||
/// Write to the given `file` if the `content` is different.
|
||||
fn write_file_if_changed(file: PathBuf, content: String) {
|
||||
if fs::read_to_string(&file).ok().as_ref() != Some(&content) {
|
||||
fs::write(&file, content).expect(&format!("Writing `{}` can not fail!", file.display()));
|
||||
fs::write(&file, content).unwrap_or_else(|_| panic!("Writing `{}` can not fail!", file.display()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ fn copy_file_if_changed(src: PathBuf, dst: PathBuf) {
|
||||
|
||||
if src_file != dst_file {
|
||||
fs::copy(&src, &dst)
|
||||
.expect(&format!("Copying `{}` to `{}` can not fail; qed", src.display(), dst.display()));
|
||||
.unwrap_or_else(|_| panic!("Copying `{}` to `{}` can not fail; qed", src.display(), dst.display()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user