Skip to content

Commit 0a97ed3

Browse files
committed
convert learning-tasks slides to mdbook
1 parent 60ab939 commit 0a97ed3

20 files changed

Lines changed: 145 additions & 120 deletions

books/learning-tasks/book.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[book]
2+
authors = ["Gabor Szabo"]
3+
language = "en"
4+
src = "src"
5+
title = "Rust Learning Tasks"
6+
7+
# Add github icon to the menu
8+
[output.html]
9+
git-repository-url = "https://github.com/szabgab/rust.code-maven.com"
10+
git-repository-icon = "fa-github"
11+
edit-url-template = "https://github.com/szabgab/rust.code-maven.com/edit/main/books/learning-tasks/{path}"
12+
13+
# Handle Youtube video embedding and the footer
14+
[preprocessor.embedify]
15+
footer.enable = true
16+
footer.message = "Copyright © 2025 • Created with ❤️ by [Gábor Szabó](https://szabgab.com/)"
17+
18+
19+
20+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Summary
2+
3+
- [Learning tasks](./index.md)
4+
5+
- [Learning tasks](./rust/learning-tasks/index.md)
6+
- [Task: Setup environment](./rust/learning-tasks/lt-setup-environment.md)
7+
- [Task: Print Hello World](./rust/learning-tasks/lt-hello-world.md)
8+
- [Exercise: Hello world](./rust/learning-tasks/lt-exercise-hello-world.md)
9+
- [Task: Get input from command line and print it](./rust/learning-tasks/lt-get-input-from-command-line-and-print-it.md)
10+
- [Hello Foo](./rust/learning-tasks/lt-hello-foo.md)
11+
- [Task: Get two numbers from the command line and do some calculations on them](./rust/learning-tasks/lt-get-two-numbers-from-the-command-line.md)
12+
- [Set type of numbers](./rust/learning-tasks/lt-set-type-of-numbers.md)
13+
- [get two numbers from args and add them together](./rust/learning-tasks/lt-get-two-numbers-from-args.md)
14+
- [add protection to args (if , len)](./rust/learning-tasks/lt-add-protection-to-getting-args.md)
15+
- [add protection to number parsing](./rust/learning-tasks/lt-add-protection-to-number-parsing.md)
16+
- [Exercise: rectangle, circle](./rust/learning-tasks/lt-exercise-rectangle-circle.md)
17+
- [Task: Implement file-based counter](./rust/learning-tasks/lt-implement-file-based-counter.md)
18+
- [Task: Word Count (wc)](./rust/learning-tasks/lt-word-count-wc.md)
19+

books/learning-tasks/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Learning tasks
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Learning tasks
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# add protection to args (if , len)
2+
3+
4+
```rust
5+
if args.len() {
6+
eprintln!("{}", args[0]);
7+
}
8+
```
9+
10+
11+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# add protection to number parsing
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Exercise: Hello world
2+
3+
* Intsall Rust
4+
* Install VS Code or whatever IDE you prefer
5+
* Install rust-analyzer
6+
* Create a new crate
7+
* run the Hello World
8+
9+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Exercise: rectangle, circle
2+
3+
* Handle overflow
4+
5+
* Read, Write file with oneliners
6+
7+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Task: Get input from command line and print it
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# get two numbers from args and add them together
2+
3+
```rust
4+
let args = std::env::args().collect::<Vec<String>>()
5+
let x = &args[1].parse::<u32>().unwrap();
6+
let y = &args[2].parse::<u32>().except("Oh oh");
7+
```
8+
9+

0 commit comments

Comments
 (0)