Add fs_err to disallowed_method in clippy.toml (#1950)

## Summary

Resolve #1916

---------

Co-authored-by: konsti <konstin@mailbox.org>
This commit is contained in:
Taniguchi Yasufumi 2024-02-26 23:15:07 +09:00 committed by GitHub
parent a5a917169b
commit 70e877d11c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 49 additions and 11 deletions

View file

@ -17,7 +17,7 @@ pub(crate) struct RenderBenchmarksArgs {
}
pub(crate) fn render_benchmarks(args: &RenderBenchmarksArgs) -> Result<()> {
let mut results: BenchmarkResults = serde_json::from_slice(&std::fs::read(&args.path)?)?;
let mut results: BenchmarkResults = serde_json::from_slice(&fs_err::read(&args.path)?)?;
// Replace the command with a shorter name. (The command typically includes the benchmark name,
// but we assume we're running over a single benchmark here.)
@ -85,7 +85,7 @@ fn render_to_png(data: &str, path: &Path, fontdb: &fontdb::Database) -> Result<(
pixmap.as_mut(),
)
.ok_or_else(|| anyhow!("failed to render"))?;
std::fs::create_dir_all(path.parent().unwrap())?;
fs_err::create_dir_all(path.parent().unwrap())?;
pixmap.save_png(path)?;
Ok(())
}