1
0
Fork 0
mirror of https://github.com/notohh/rustlings.git synced 2025-07-24 22:40:04 -04:00

Merge branch 'master' into refactor-hints

This commit is contained in:
marisa 2019-11-11 17:21:06 +01:00 committed by GitHub
commit ec2d4bd3ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
61 changed files with 315 additions and 12 deletions

View file

@ -6,6 +6,8 @@
// this function to have.
// Execute `rustlings hint errors1` for hints!
// I AM NOT DONE
pub fn generate_nametag_text(name: String) -> Option<String> {
if name.len() > 0 {
Some(format!("Hi! My name is {}", name))

View file

@ -16,6 +16,8 @@
// There are at least two ways to implement this that are both correct-- but
// one is a lot shorter! Execute `rustlings hint errors2` for hints to both ways.
// I AM NOT DONE
use std::num::ParseIntError;
pub fn total_cost(item_quantity: &str) -> Result<i32, ParseIntError> {

View file

@ -4,6 +4,8 @@
// Why not? What should we do to fix it?
// Execute `rustlings hint errors3` for hints!
// I AM NOT DONE
use std::num::ParseIntError;
fn main() {

View file

@ -15,6 +15,8 @@
//
// Execute `rustlings hint errors4` for hints :)
// I AM NOT DONE
use std::error;
use std::fmt;
use std::io;

View file

@ -4,6 +4,8 @@
// on `None`. Handle this in a more graceful way than calling `unwrap`!
// Execute `rustlings hint option1` for hints :)
// I AM NOT DONE
pub fn pop_too_much() -> bool {
let mut list = vec![3];

View file

@ -1,6 +1,8 @@
// result1.rs
// Make this test pass! Execute `rustlings hint option2` for hints :)
// I AM NOT DONE
#[derive(PartialEq, Debug)]
struct PositiveNonzeroInteger(u64);