Compare commits

...

6 Commits

Author SHA1 Message Date
rithvik-bosch
ffb2f08b67 nit: grammar (#70) 2024-05-29 10:59:32 +02:00
LukeMathWalker
baca47f782 Add a TODO to make things more explicit. 2024-05-28 11:18:27 +02:00
LukeMathWalker
d442b61795 Reword. 2024-05-28 11:11:41 +02:00
Keshav Chakravarthy
d77272a5b4 Better example for ownership transfer using String (#68)
* Better example for ownership transfer using String

* Update book/src/03_ticket_v1/06_ownership.md

---------

Co-authored-by: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com>
2024-05-28 11:08:34 +02:00
Ernie Hershey
deb4ccb643 Grammar typo (#65) 2024-05-28 11:05:59 +02:00
Onè
35a2ff1efe Change execution unit name (#60) 2024-05-28 11:05:46 +02:00
6 changed files with 8 additions and 9 deletions

View File

@@ -95,8 +95,8 @@ Ownership can be transferred.
If you own a value, for example, you can transfer ownership to another variable:
```rust
let a = 42; // <--- `a` is the owner of the value `42`
let b = a; // <--- `b` is now the owner of the value `42`
let a = "hello, world".to_string(); // <--- `a` is the owner of the String
let b = a; // <--- `b` is now the owner of the String
```
Rust's ownership system is baked into the type system: each function has to declare in its signature

View File

@@ -58,7 +58,7 @@ You've already encountered a few macros in past exercises:
Rust macros are **code generators**.\
They generate new Rust code based on the input you provide, and that generated code is then compiled alongside
the rest of your program. Some macros are built into Rust's standard library, but you can also
write your own. We won't be creating our macro in this course, but you can find some useful
write your own. We won't be creating our own macro in this course, but you can find some useful
pointers in the ["Further reading" section](#further-reading).
### Inspection

View File

@@ -66,7 +66,7 @@ assert_eq!(numbers.get(0), Some(&1));
assert_eq!(numbers.get(3), None);
```
Access is bounds-checked, just element access with arrays. It has O(1) complexity.
Access is bounds-checked, just like element access with arrays. It has O(1) complexity.
## Memory layout

View File

@@ -99,7 +99,7 @@ pub async fn run() {
if let Ok(reason) = e.try_into_panic() {
// The task has panicked
// We resume unwinding the panic,
// thus propagating it to the current thread
// thus propagating it to the current task
panic::resume_unwind(reason);
}
}

View File

@@ -28,8 +28,7 @@ project and on [exercism.io](https://exercism.io)'s Rust track.
Check out [the Rust book](https://doc.rust-lang.org/book/title-page.html) and
["Programming Rust"](https://www.oreilly.com/library/view/programming-rust-2nd/9781492052586/)
if you're looking for a different perspective on the same concepts we covered throughout this course.
The material doesn't overlap perfectly, therefore you'll certainly learn something new along the
way.
You'll certainly learn something new since they don't cover exactly the same topics; Rust has a lot of surface area!
### Advanced material

View File

@@ -1,3 +1,5 @@
// TODO: Set `move_forward` to `true` in `ready` when you think you're done with this exercise.
// Feel free to call an instructor to verify your solution!
use channels::data::TicketDraft;
use channels::{launch, Command};
use std::time::Duration;
@@ -24,8 +26,6 @@ fn ready() {
// since our server doesn't expose any **read** actions.
// We have no way to know if the inserts are actually happening and if they
// are happening correctly.
// Set `move_forward` to `true` when you think you're done with this exercise.
// Feel free to call an instructor to verify your solution!
let move_forward = false;
assert!(move_forward);