summaryrefslogtreecommitdiffstats
path: root/vendor/gix-object/src/tree
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/gix-object/src/tree
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-object/src/tree')
-rw-r--r--vendor/gix-object/src/tree/write.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/vendor/gix-object/src/tree/write.rs b/vendor/gix-object/src/tree/write.rs
index 91e1dc2e0..e1a82720f 100644
--- a/vendor/gix-object/src/tree/write.rs
+++ b/vendor/gix-object/src/tree/write.rs
@@ -57,10 +57,12 @@ impl crate::WriteTo for Tree {
Kind::Tree
}
- fn size(&self) -> usize {
+ fn size(&self) -> u64 {
self.entries
.iter()
- .map(|Entry { mode, filename, oid }| mode.as_bytes().len() + 1 + filename.len() + 1 + oid.as_bytes().len())
+ .map(|Entry { mode, filename, oid }| {
+ (mode.as_bytes().len() + 1 + filename.len() + 1 + oid.as_bytes().len()) as u64
+ })
.sum()
}
}
@@ -100,11 +102,11 @@ impl<'a> crate::WriteTo for TreeRef<'a> {
Kind::Tree
}
- fn size(&self) -> usize {
+ fn size(&self) -> u64 {
self.entries
.iter()
.map(|EntryRef { mode, filename, oid }| {
- mode.as_bytes().len() + 1 + filename.len() + 1 + oid.as_bytes().len()
+ (mode.as_bytes().len() + 1 + filename.len() + 1 + oid.as_bytes().len()) as u64
})
.sum()
}