mirror of
https://github.com/notohh/rustlings.git
synced 2025-08-13 14:23:36 -04:00
Merge pull request #1641 from mo8it/move-semantics5-test
Convert exercises with assertions to tests
This commit is contained in:
commit
4d04aad890
6 changed files with 9 additions and 5 deletions
exercises
iterators
move_semantics
smart_pointers
threads
|
@ -11,6 +11,7 @@
|
|||
|
||||
// I AM NOT DONE
|
||||
|
||||
#[test]
|
||||
fn main() {
|
||||
let my_fav_fruits = vec!["banana", "custard apple", "avocado", "peach", "raspberry"];
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// move_semantics3.rs
|
||||
//
|
||||
// Make me compile without adding new lines-- just changing existing lines! (no
|
||||
// Make me compile without adding new lines -- just changing existing lines! (no
|
||||
// lines with multiple semicolons necessary!)
|
||||
//
|
||||
// Execute `rustlings hint move_semantics3` or use the `hint` watch subcommand
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// I AM NOT DONE
|
||||
|
||||
#[test]
|
||||
fn main() {
|
||||
let mut x = 100;
|
||||
let y = &mut x;
|
||||
|
|
|
@ -35,6 +35,7 @@ impl Planet {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn main() {
|
||||
let sun = Rc::new(Sun {});
|
||||
println!("reference count = {}", Rc::strong_count(&sun)); // 1 reference
|
||||
|
|
|
@ -48,6 +48,7 @@ fn send_tx(q: Queue, tx: mpsc::Sender<u32>) -> () {
|
|||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn main() {
|
||||
let (tx, rx) = mpsc::channel();
|
||||
let queue = Queue::new();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue