always a size
This commit is contained in:
@@ -179,8 +179,7 @@ pub struct GameFileDescription {
|
||||
pub game_id: String,
|
||||
pub relative_path: String,
|
||||
pub is_dir: bool,
|
||||
#[serde(default)]
|
||||
pub size: Option<u64>,
|
||||
pub size: u64,
|
||||
}
|
||||
|
||||
impl GameFileDescription {
|
||||
@@ -190,8 +189,8 @@ impl GameFileDescription {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn file_size(&self) -> Option<u64> {
|
||||
if self.is_dir { None } else { self.size }
|
||||
pub fn file_size(&self) -> u64 {
|
||||
if self.is_dir { 0 } else { self.size }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +203,7 @@ impl fmt::Debug for GameFileDescription {
|
||||
self.game_id,
|
||||
if self.is_dir { 'D' } else { 'F' },
|
||||
self.relative_path,
|
||||
self.size.unwrap_or_default(),
|
||||
self.size,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user