Skip to content

Commit

Permalink
style: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
llenotre committed Aug 28, 2024
1 parent 0983ec2 commit 0a18749
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions kernel/src/file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,16 @@ impl File {
if unlikely(!self.can_write()) {
return Err(errno!(EACCES));
}
let stat = self.vfs_entry.node.ops.get_stat(&self.vfs_entry.node.location)?;
let stat = self
.vfs_entry
.node
.ops
.get_stat(&self.vfs_entry.node.location)?;
match stat.get_type() {
// If the file is a device, do nothing
Some(FileType::BlockDevice | FileType::CharDevice) => Ok(()),
_ => self.vfs_entry
_ => self
.vfs_entry
.node
.ops
.truncate_content(&self.vfs_entry.node.location, size),
Expand Down

0 comments on commit 0a18749

Please sign in to comment.