From 7e8ee5ed9cad6484e9f13f81731b102ced58402e Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Tue, 9 Jul 2019 15:14:04 -0400 Subject: Init. --- rust-book/advanced/adv-types/Cargo.lock | 4 ++++ rust-book/advanced/adv-types/Cargo.toml | 7 ++++++ rust-book/advanced/adv-types/src/main.rs | 41 ++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100755 rust-book/advanced/adv-types/Cargo.lock create mode 100755 rust-book/advanced/adv-types/Cargo.toml create mode 100755 rust-book/advanced/adv-types/src/main.rs (limited to 'rust-book/advanced/adv-types') diff --git a/rust-book/advanced/adv-types/Cargo.lock b/rust-book/advanced/adv-types/Cargo.lock new file mode 100755 index 0000000..a7ad78b --- /dev/null +++ b/rust-book/advanced/adv-types/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "adv-types" +version = "0.1.0" + diff --git a/rust-book/advanced/adv-types/Cargo.toml b/rust-book/advanced/adv-types/Cargo.toml new file mode 100755 index 0000000..a3ca211 --- /dev/null +++ b/rust-book/advanced/adv-types/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "adv-types" +version = "0.1.0" +authors = ["Adam Carpenter <53hornet@gmail.com>"] +edition = "2018" + +[dependencies] diff --git a/rust-book/advanced/adv-types/src/main.rs b/rust-book/advanced/adv-types/src/main.rs new file mode 100755 index 0000000..60d42b2 --- /dev/null +++ b/rust-book/advanced/adv-types/src/main.rs @@ -0,0 +1,41 @@ +//use std::io::Error; +//use std::fmt; + +//pub trait Write { +// +// fn write(&mut self, buf: &[u8]) -> Result; +// fn flush(&mut self) -> Result<(), Error>; +// +// fn write_all(&mut self, buf: &[u8]) -> Result<()>; +// fn write_fmt(&mut self, fmt: fmt::Arguments) -> Result<()>; +//} + +//fn main() { +// type Miles = i32; +// +// let x: i32 = 5; +// let y: Miles = 5; +// +// println!("x + y = {}", x + y); + + +//} + +//type Thunk = Box; +// +//let f: Thunk = Box::new(|| println!("hi")); +// +//fn takes_long_type(f: Thunk) { +//} +// +//fn returns_long_type() -> Thunk { +//} + +fn main() { + print!("forever"); + + loop { + print!("and ever "); + } +} + -- cgit v1.2.3