Skip to content

Commit

Permalink
Appease clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
encounter committed Apr 3, 2024
1 parent 3497d38 commit a156c36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/util/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ where P: AsRef<Path> {
if path.as_ref().exists() {
set_file_mtime(path, FileTime::now())
} else {
match OpenOptions::new().create(true).write(true).open(path) {
match OpenOptions::new().create(true).truncate(true).write(true).open(path) {
Ok(_) => Ok(()),
Err(e) => Err(e),
}
Expand Down
6 changes: 1 addition & 5 deletions src/util/rarc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,7 @@ impl<'parent> Iterator for Nodes<'parent> {
type Item = Node;

fn next(&mut self) -> Option<Self::Item> {
let Some(state) = self.stack.pop() else {
return None;
};

match state {
match self.stack.pop()? {
NodeState::Begin(name) => {
self.stack.push(NodeState::File(name.clone(), 0));
Some(Node::DirectoryBegin { name })
Expand Down

0 comments on commit a156c36

Please sign in to comment.