diff --git a/testing_rust_again/.gitignore b/testing_rust_again/.gitignore new file mode 100644 index 0000000..53eaa21 --- /dev/null +++ b/testing_rust_again/.gitignore @@ -0,0 +1,2 @@ +/target +**/*.rs.bk diff --git a/testing_rust_again/Cargo.lock b/testing_rust_again/Cargo.lock new file mode 100644 index 0000000..1c89607 --- /dev/null +++ b/testing_rust_again/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "testing_rust_again" +version = "0.1.0" + diff --git a/testing_rust_again/Cargo.toml b/testing_rust_again/Cargo.toml new file mode 100644 index 0000000..3811bac --- /dev/null +++ b/testing_rust_again/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "testing_rust_again" +version = "0.1.0" +authors = ["Penguin <...>"] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/testing_rust_again/GPATH b/testing_rust_again/GPATH new file mode 100644 index 0000000..d1b3b58 Binary files /dev/null and b/testing_rust_again/GPATH differ diff --git a/testing_rust_again/GRTAGS b/testing_rust_again/GRTAGS new file mode 100644 index 0000000..604f148 Binary files /dev/null and b/testing_rust_again/GRTAGS differ diff --git a/testing_rust_again/GTAGS b/testing_rust_again/GTAGS new file mode 100644 index 0000000..7a6cfa3 Binary files /dev/null and b/testing_rust_again/GTAGS differ diff --git a/testing_rust_again/src/main.rs b/testing_rust_again/src/main.rs new file mode 100644 index 0000000..a7ec7fc --- /dev/null +++ b/testing_rust_again/src/main.rs @@ -0,0 +1,38 @@ +use std::fs; +fn main() +{ + println!("Hello, world!"); + + + match fs::create_dir("a") + { + Err(why) => println!("! {:?}", why.kind()), + Ok(_) => {}, + } + + println!("We just made a new directory! Printing...\n"); + match fs::read_dir(".") + { + Err(why) => println!("! {:?}", why.kind()), + Ok(paths) => for path in paths + { + println!("> {:?}", path.unwrap().path()); + }, + } + + fs::remove_dir("a").unwrap_or_else(|why| { + println!("! {:?}", why.kind()); + }); + + + println!("We just removed that directory! Printing...\n"); + match fs::read_dir(".") + { + Err(why) => println!("! {:?}", why.kind()), + Ok(paths) => for path in paths + { + println!("> {:?}", path.unwrap().path()); + }, + } + +}