fix(tvix/castore): u32 -> u64 in DirectoryError::SizeOverflow message

Fix a discrepancy in the error message for DirectoryError::SizeOverflow.

The message indicates that the SizeOverflow error occurs when total size
exceeds u32::MAX, but that's not true. All size fields within the
castore's internal Directory ADT are u64, and the SizeOverflow error is
only returned after a call to the checked_add implementation on u64.

See tvix/castore/nodes/directory.rs +111
and tvix/castore/nodes/directory.rs +88
as of this commit.

Change-Id: I74d161ea8927362e1cb601ba163489aa96fb91b1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12259
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
Ben Webb 2024-08-20 17:19:26 -05:00 committed by benjaminedwardwebb
parent e03ea11bad
commit 565c0fd24c

View file

@ -47,7 +47,7 @@ pub enum DirectoryError {
/// Node failed validation /// Node failed validation
#[error("invalid node with name {}: {:?}", .0, .1.to_string())] #[error("invalid node with name {}: {:?}", .0, .1.to_string())]
InvalidNode(PathComponent, ValidateNodeError), InvalidNode(PathComponent, ValidateNodeError),
#[error("Total size exceeds u32::MAX")] #[error("Total size exceeds u64::MAX")]
SizeOverflow, SizeOverflow,
/// Invalid name encountered /// Invalid name encountered
#[error("Invalid name: {0}")] #[error("Invalid name: {0}")]