Skip to content

Commit

Permalink
jerking fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lerina committed Dec 26, 2023
1 parent adf03d7 commit 9486a2d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1,928 deletions.
18 changes: 18 additions & 0 deletions html/code/dev_notes/input_output.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,24 @@ fn main() {
}
}
```

## Removing a File in Rust

To remove or delete a file in Rust, we can use the remove_file() method from the std::fs module.

```rust
use std::fs;

fn main() {
// Remove a file
fs::remove_file("data.txt").expect("could not remove file");

println!("Removed file data.txt");
}
```

---

</main>
<script src="https://lerina.github.io/js/toc.js"></script>
<script>
Expand Down
Loading

0 comments on commit 9486a2d

Please sign in to comment.