Extra-clarity qualification

Regard the preceding wording “we’ve annotated the types of the values that are returned from these functions for extra clarity.” while only the indexing function is annotated.
This commit is contained in:
JirCep
2022-05-02 17:59:39 +02:00
committed by Carol (Nichols || Goulding)
parent 96d4b0ec1c
commit eedc18924d

View File

@@ -5,7 +5,8 @@ fn main() {
let third: &i32 = &v[2];
println!("The third element is {}", third);
match v.get(2) {
let third: Option<&i32> = v.get(2);
match third {
Some(third) => println!("The third element is {}", third),
None => println!("There is no third element."),
}