diff options
author | garhve <git@garhve.com> | 2023-01-01 23:23:55 +0800 |
---|---|---|
committer | garhve <git@garhve.com> | 2023-01-01 23:23:55 +0800 |
commit | 0e89468188b9d347495dad5b98af137e5f477432 (patch) | |
tree | 0109b539d1defe6469099476df262838ddf02320 /rust/theBook/chapter-9-error-handling/panic | |
parent | bbc35c878f0f0fcf7234f23efb6820aebf4287c3 (diff) |
finish chapter 9
Diffstat (limited to 'rust/theBook/chapter-9-error-handling/panic')
-rw-r--r-- | rust/theBook/chapter-9-error-handling/panic/Cargo.toml | 8 | ||||
-rw-r--r-- | rust/theBook/chapter-9-error-handling/panic/src/main.rs | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/rust/theBook/chapter-9-error-handling/panic/Cargo.toml b/rust/theBook/chapter-9-error-handling/panic/Cargo.toml new file mode 100644 index 0000000..f484c90 --- /dev/null +++ b/rust/theBook/chapter-9-error-handling/panic/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "panic" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rust/theBook/chapter-9-error-handling/panic/src/main.rs b/rust/theBook/chapter-9-error-handling/panic/src/main.rs new file mode 100644 index 0000000..a3bc2a7 --- /dev/null +++ b/rust/theBook/chapter-9-error-handling/panic/src/main.rs @@ -0,0 +1,5 @@ +fn main() { + let x = vec![1,2,3]; + + x[99]; +} |