Skip to content

Commit 0cebb1f

Browse files
src/dumpfile: minor reorg
Let's pass a string instead of a Sha256HashValue to write_entry(). This will save us a substantial amount of grief with generics in the next commit. Signed-off-by: Allison Karlitskaya <[email protected]>
1 parent 2efc39a commit 0cebb1f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/dumpfile.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use anyhow::Result;
1212
use rustix::fs::FileType;
1313

1414
use crate::{
15-
fsverity::{FsVerityHashValue, Sha256HashValue},
15+
fsverity::FsVerityHashValue,
1616
image::{Directory, FileSystem, Inode, Leaf, LeafContent, RegularFile, Stat},
1717
};
1818

@@ -49,7 +49,7 @@ fn write_entry(
4949
rdev: u64,
5050
payload: impl AsRef<OsStr>,
5151
content: &[u8],
52-
digest: Option<&Sha256HashValue>,
52+
digest: Option<&str>,
5353
) -> fmt::Result {
5454
let mode = stat.st_mode | ifmt.as_raw_mode();
5555
let uid = stat.st_uid;
@@ -66,7 +66,7 @@ fn write_entry(
6666
write_escaped(writer, content)?;
6767
write!(writer, " ")?;
6868
if let Some(id) = digest {
69-
write!(writer, "{}", id.to_hex())?;
69+
write!(writer, "{}", id)?;
7070
} else {
7171
write_empty(writer)?;
7272
}
@@ -131,7 +131,7 @@ pub fn write_leaf(
131131
0,
132132
id.to_object_pathname(),
133133
&[],
134-
Some(id),
134+
Some(&id.to_hex()),
135135
),
136136
LeafContent::BlockDevice(rdev) => write_entry(
137137
writer,

0 commit comments

Comments
 (0)