mirror of https://github.com/01-edu/public.git
eslopfer
2 years ago
1 changed files with 39 additions and 0 deletions
@ -0,0 +1,39 @@
|
||||
## print_and_consume |
||||
|
||||
### Instructions |
||||
|
||||
Create a function `print_and_consume` which takes a `String`, print the string with a new line at the end and consume it (the string can't be used after the function is called). |
||||
|
||||
Create a function `only_print` that takes a `String` and print it with a new line without consuming it. |
||||
|
||||
### Expected functions |
||||
|
||||
```rust |
||||
pub fn print_and_consume(argument) { |
||||
} |
||||
|
||||
pub fn only_print(argument) { |
||||
} |
||||
|
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function : |
||||
|
||||
```rust |
||||
use print_and_consume::*; |
||||
|
||||
fn main() { |
||||
|
||||
|
||||
} |
||||
``` |
||||
|
||||
And its output: |
||||
|
||||
```console |
||||
$ cargo run |
||||
|
||||
$ |
||||
``` |
Loading…
Reference in new issue