mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-11-29 22:47:43 +02:00
Clean up and unify exercises
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
// strings1.rs
|
||||
//
|
||||
// Make me compile without changing the function signature!
|
||||
//
|
||||
// Execute `rustlings hint strings1` or use the `hint` watch subcommand for a
|
||||
// hint.
|
||||
|
||||
fn main() {
|
||||
let answer = current_favorite_color();
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
// strings2.rs
|
||||
//
|
||||
// Make me compile without changing the function signature!
|
||||
//
|
||||
// Execute `rustlings hint strings2` or use the `hint` watch subcommand for a
|
||||
// hint.
|
||||
|
||||
fn main() {
|
||||
let word = String::from("green"); // Try not changing this line :)
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
// strings3.rs
|
||||
//
|
||||
// Execute `rustlings hint strings3` or use the `hint` watch subcommand for a
|
||||
// hint.
|
||||
|
||||
fn trim_me(input: &str) -> String {
|
||||
// TODO: Remove whitespace from both ends of a string!
|
||||
???
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
// strings4.rs
|
||||
//
|
||||
// Ok, here are a bunch of values-- some are `String`s, some are `&str`s. Your
|
||||
// Ok, here are a bunch of values - some are `String`s, some are `&str`s. Your
|
||||
// task is to call one of these two functions on each value depending on what
|
||||
// you think each value is. That is, add either `string_slice` or `string`
|
||||
// before the parentheses on each line. If you're right, it will compile!
|
||||
//
|
||||
// No hints this time!
|
||||
|
||||
fn string_slice(arg: &str) {
|
||||
println!("{}", arg);
|
||||
|
||||
Reference in New Issue
Block a user