diff options
Diffstat (limited to 'advanced/adv-fn-closure')
-rw-r--r-- | advanced/adv-fn-closure/Cargo.lock | 11 | ||||
-rw-r--r-- | advanced/adv-fn-closure/Cargo.toml | 8 | ||||
-rw-r--r-- | advanced/adv-fn-closure/src/main.rs | 79 |
3 files changed, 0 insertions, 98 deletions
diff --git a/advanced/adv-fn-closure/Cargo.lock b/advanced/adv-fn-closure/Cargo.lock deleted file mode 100644 index 360607c..0000000 --- a/advanced/adv-fn-closure/Cargo.lock +++ /dev/null @@ -1,11 +0,0 @@ -[[package]] -name = "adv-fn-closure" -version = "0.1.0" -dependencies = [ - "hello_macro 0.1.0", -] - -[[package]] -name = "hello_macro" -version = "0.1.0" - diff --git a/advanced/adv-fn-closure/Cargo.toml b/advanced/adv-fn-closure/Cargo.toml deleted file mode 100644 index 6cd8dbd..0000000 --- a/advanced/adv-fn-closure/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "adv-fn-closure" -version = "0.1.0" -authors = ["Adam Carpenter <53hornet@gmail.com>"] -edition = "2018" - -[dependencies] -hello_macro = { path = "../hello_macro" } diff --git a/advanced/adv-fn-closure/src/main.rs b/advanced/adv-fn-closure/src/main.rs deleted file mode 100644 index 064f300..0000000 --- a/advanced/adv-fn-closure/src/main.rs +++ /dev/null @@ -1,79 +0,0 @@ -use hello_macro::HelloMacro; -//use hello_macro_derive::HelloMacro; - -struct Pancakes; - -impl HelloMacro for Pancakes { - fn hello_macro() { - println!("pancakes"); - } -} - -fn main() { - Pancakes::hello_macro(); -} - -//fn add_one(x: i32) -> i32 { -// x + 1 -//} -// -//fn do_twice(f: fn(i32) -> i32, arg: i32) -> i32 { -// f(arg) + f(arg) -//} - - -//fn returns_closure() -> Box<dyn Fn(i32) -> i32> { -// Box::new(|x| x + 1) -//} -// -// -//enum Status { -// Value(u32), -// Stop, -//} - - -//#[macro_export] -//macro_rules! vec { -// ( $( $x:expr ), * ) => { -// { -// let mut temp_vec = Vec::new(); -// $( -// temp_vec.push($x); -// )* -// temp_vec -// } -// }; -//} - - -//#[some_attribute] -//pub fn some_name(input: TokenStream) -> TokenStream { -//} -// -// -//fn main() { -// let answer = do_twice(add_one, 5); -// -// println!("{}", answer); - - -// let list_of_numbers = vec![1, 2, 3]; -// let list_of_strings: Vec<String> = list_of_numbers -// .iter() -// .map(ToString::to_string) -// .collect(); -// dbg!(list_of_strings); - - -// let list_of_statuses: Vec<Status> = -// (0u32..20) -// .map(Status::Value) -// .collect(); - - - //returns_closure(); - - - -//} |