summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-10-06 06:20:14 +0000
committerLars Wirzenius <liw@liw.fi>2022-10-06 06:20:14 +0000
commitd2ca98e7e57a534bde4dc9fb8366f61fc35b277e (patch)
tree13c610d3da8ac068e9f75f7b0e9c1d2db71f54f8
parent0f28bb642c3222bde22135163b201ab1d65b5059 (diff)
parent52e01eb6a847dcbffdfc6a2464d23b3fcabfb76c (diff)
downloadcachedir-rs-d2ca98e7e57a534bde4dc9fb8366f61fc35b277e.tar.gz
Merge branch 'fix' into 'main'
fix: formatting See merge request obnam/cachedir!9
-rw-r--r--build.rs3
-rw-r--r--src/bin/cachedir.rs2
-rw-r--r--src/lib.rs3
3 files changed, 4 insertions, 4 deletions
diff --git a/build.rs b/build.rs
index 5b717b2..c19be14 100644
--- a/build.rs
+++ b/build.rs
@@ -2,5 +2,6 @@ use std::path::Path;
fn main() {
println!("cargo:rerun-if-changed=build.rs");
- subplot_build::codegen(Path::new("cachedir.subplot")).expect("failed to generate code with Subplot");
+ subplot_build::codegen(Path::new("cachedir.subplot"))
+ .expect("failed to generate code with Subplot");
}
diff --git a/src/bin/cachedir.rs b/src/bin/cachedir.rs
index 965a14d..dd4a724 100644
--- a/src/bin/cachedir.rs
+++ b/src/bin/cachedir.rs
@@ -14,8 +14,8 @@
use cachedir::{is_cachedir_tag, CacheDirError, CACHEDIR_TAG, TAG};
use clap::{Parser, Subcommand};
-use std::fs::{remove_file, write};
use std::error::Error;
+use std::fs::{remove_file, write};
use std::path::PathBuf;
use walkdir::{DirEntry, WalkDir};
diff --git a/src/lib.rs b/src/lib.rs
index 40f4f11..d622208 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -23,8 +23,7 @@ pub fn is_cachedir_tag(filename: &Path) -> Result<bool, CacheDirError> {
}
// Does the file start with the right prefix?
- let data = read(filename)
- .map_err(|e| CacheDirError::Read(filename.into(), e))?;
+ let data = read(filename).map_err(|e| CacheDirError::Read(filename.into(), e))?;
if data.len() >= TAG.len() {
Ok(&data[..TAG.len()] == TAG.as_bytes())
} else {