datatypes

master
Andrew Johnson 6 years ago
parent 3ddf200ff0
commit ae67b0e19c

@ -42,7 +42,7 @@ fn thread1() {
let handle = thread::spawn(move || {
println!("Here's a vector: {:?}", v);
});
handle.join();
handle.join().ok();
}
fn thread2()
@ -70,7 +70,7 @@ fn thread3() {
let v = vec![1, 2, 3];
sender.send(v).unwrap();
});
handle.join();
handle.join().ok();
receiver.recv().unwrap();
}

@ -1,6 +1,11 @@
//It can be helpful to create shorthand names for complex types
//alias
type Name = String;
//newtype
struct NewName(String);
//Structs can be repetitive if you just want a way to store multiple values together
struct Data1
{

Loading…
Cancel
Save