From 9486a2da71f80cf89f0d6e0bfe0e849f868d5748 Mon Sep 17 00:00:00 2001 From: Lerina J-Y Razafy Date: Tue, 26 Dec 2023 16:28:10 -0500 Subject: [PATCH] jerking fix --- html/code/dev_notes/input_output.md | 18 + .../dev_notes/macros_and_attributes.html | 1066 ----------------- .../dev_notes/macros_and_attributes.md | 862 ------------- 3 files changed, 18 insertions(+), 1928 deletions(-) delete mode 100644 html/code/rust-wasm/dev_notes/macros_and_attributes.html delete mode 100644 html/code/rust-wasm/dev_notes/macros_and_attributes.md diff --git a/html/code/dev_notes/input_output.md b/html/code/dev_notes/input_output.md index 187dfce..bcf54e9 100644 --- a/html/code/dev_notes/input_output.md +++ b/html/code/dev_notes/input_output.md @@ -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"); +} +``` + +--- +