1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-10 00:44:21 +02:00
This commit is contained in:
Martin Geisler 2023-01-11 14:47:34 +01:00 committed by GitHub
parent 02e1f4b879
commit 6b8ee3c979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ fn main() {
* `Option` and `Result` are widely used not just in the standard library.
* `Option<&T>` has zero space overhead compared to `&T`.
* `Result` is the standard type to implement error handling as we will see on Day 3.
* `binary_search` returns `Result<usize, usize`.
* `binary_search` returns `Result<usize, usize>`.
* If found, `Result::Ok` holds the index where the element is found.
* Otherwise, `Result::Err` contains the index where such an element should be inserted.