mirror of
https://github.com/notohh/rustlings.git
synced 2025-07-11 10:25:34 -04:00
Added filename to top of .rs files
This commit is contained in:
parent
c4b3252845
commit
7d7a48b17d
48 changed files with 50 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
// errors1.rs
|
||||
// This function refuses to generate text to be printed on a nametag if
|
||||
// you pass it an empty string. It'd be nicer if it explained what the problem
|
||||
// was, instead of just sometimes returning `None`. The 2nd test currently
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// errors2.rs
|
||||
// Say we're writing a game where you can buy items with tokens. All items cost
|
||||
// 5 tokens, and whenever you purchase items there is a processing fee of 1
|
||||
// token. A player of the game will type in how many items they want to buy,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// errors3.rs
|
||||
// This is a program that is trying to use a completed version of the
|
||||
// `total_cost` function from the previous exercise. It's not working though--
|
||||
// we can't call the `try!` macro in the `main()` function! Why not?
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// errorsn.rs
|
||||
// This is a bigger error exercise than the previous ones!
|
||||
// You can do it!
|
||||
//
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// option1.rs
|
||||
// This example panics because the second time it calls `pop`, the `vec`
|
||||
// is empty, so `pop` returns `None`, and `unwrap` panics if it's called
|
||||
// on `None`. Handle this in a more graceful way than calling `unwrap`!
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// result1.rs
|
||||
// Make this test pass! Scroll down for hints :)
|
||||
|
||||
#[derive(PartialEq,Debug)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue