about summary refs log tree commit diff
path: root/tvix/store/src/proto.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2022-12-27T23·15+0100
committerflokli <flokli@flokli.de>2022-12-28T10·58+0000
commitf930c91086f4878d8864dc58f9e45e749b624cc0 (patch)
tree7570646ad5db7bc3eec0cfc89ba1c175a48cfbb2 /tvix/store/src/proto.rs
parent50ae39f32c1eb6f8eaa6b71ef6dbbcf237a53231 (diff)
chore(tvix/store): use Directory::default in some more places r/5518
Change-Id: Iebad5e0b38f9506933fa855e1bfb2611d27ff572
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7655
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/store/src/proto.rs')
-rw-r--r--tvix/store/src/proto.rs24
1 files changed, 6 insertions, 18 deletions
diff --git a/tvix/store/src/proto.rs b/tvix/store/src/proto.rs
index cee8aeec5472..a9d23bac3977 100644
--- a/tvix/store/src/proto.rs
+++ b/tvix/store/src/proto.rs
@@ -36,11 +36,7 @@ mod tests {
     #[test]
     fn test_directory_size() {
         {
-            let d = Directory {
-                directories: vec![],
-                files: vec![],
-                symlinks: vec![],
-            };
+            let d = Directory::default();
             assert_eq!(d.size(), 0);
         }
         {
@@ -50,8 +46,7 @@ mod tests {
                     digest: vec![],
                     size: 0,
                 }],
-                files: vec![],
-                symlinks: vec![],
+                ..Default::default()
             };
             assert_eq!(d.size(), 1);
         }
@@ -62,32 +57,29 @@ mod tests {
                     digest: DUMMY_DIGEST.to_vec(),
                     size: 4,
                 }],
-                files: vec![],
-                symlinks: vec![],
+                ..Default::default()
             };
             assert_eq!(d.size(), 5);
         }
         {
             let d = Directory {
-                directories: vec![],
                 files: vec![FileNode {
                     name: String::from("foo"),
                     digest: DUMMY_DIGEST.to_vec(),
                     size: 42,
                     executable: false,
                 }],
-                symlinks: vec![],
+                ..Default::default()
             };
             assert_eq!(d.size(), 1);
         }
         {
             let d = Directory {
-                directories: vec![],
-                files: vec![],
                 symlinks: vec![SymlinkNode {
                     name: String::from("foo"),
                     target: String::from("bar"),
                 }],
+                ..Default::default()
             };
             assert_eq!(d.size(), 1);
         }
@@ -95,11 +87,7 @@ mod tests {
 
     #[test]
     fn test_digest() {
-        let d = Directory {
-            directories: vec![],
-            files: vec![],
-            symlinks: vec![],
-        };
+        let d = Directory::default();
 
         assert_eq!(
             d.digest(),