mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-12-19 23:52:15 +02:00
Added filename to top of .rs files
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user