This commit is contained in:
sxyazi 2025-09-14 02:47:18 +08:00
parent 895f0d9311
commit 20f60fa11f
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ impl Init {
pub fn len(&self) -> usize {
size_of_val(&self.version)
+ self.extensions.iter().map(|(k, v)| 8 + k.len() + v.len()).sum::<usize>()
+ self.extensions.iter().map(|(k, v)| 4 + k.len() + 4 + v.len()).sum::<usize>()
}
}

View file

@ -11,6 +11,6 @@ pub struct Version {
impl Version {
pub fn len(&self) -> usize {
size_of_val(&self.version)
+ self.extensions.iter().map(|(k, v)| 8 + k.len() + v.len()).sum::<usize>()
+ self.extensions.iter().map(|(k, v)| 4 + k.len() + 4 + v.len()).sum::<usize>()
}
}