Skip to content

Commit d285ccc

Browse files
committed
Add rust chrono note, adjust other rust notes
1 parent f9b03b7 commit d285ccc

File tree

6 files changed

+51
-21
lines changed

6 files changed

+51
-21
lines changed

notes/language/rust/crates/chrono.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Chrono
3+
ref: https://docs.rs/chrono/latest/chrono/index.html
4+
---
5+
6+
## Install
7+
8+
Perform operations on dates and times.
9+
10+
```shell
11+
cargo add chrono
12+
```
13+
14+
## Usage
15+
16+
Print current datetime in an arbitrary format:
17+
18+
```rust
19+
use chrono::prelude::*;
20+
21+
fn main() {
22+
let now: DateTime<Local> = Local::now();
23+
println!("{}", now.format("%Y-%m-%d %H:%M:%S"));
24+
}
25+
```

notes/language/rust/crates/clap.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ title: Clap
33
ref: https://docs.rs/clap/latest/clap/_derive/_tutorial/chapter_0/index.html
44
---
55

6-
## Usage
6+
## Install
77

8-
Command Line Argument Parser for Rust.
8+
Command line argument parser.
99

1010
```shell
1111
cargo add -F derive clap
1212
```
1313

14+
## Usage
15+
1416
Example of program with 3 available arguments:
1517

1618
- `-r/--random` boolean

notes/language/rust/crates/iced.md

+7-12
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,17 @@ title: Iced
33
ref: https://book.iced.rs/first-steps.html
44
---
55

6-
## Basic
6+
## Install
77

8-
A very simple example of a working GUI application
9-
(using the unreleased v0.13.0 as for 2024/08/17):
8+
Create GUI applications.
109

11-
`Cargo.toml`
10+
```shell
11+
cargo add iced
12+
```
1213

13-
```toml
14-
[package]
15-
name = "sample"
16-
version = "0.1.0"
17-
edition = "2021"
14+
## Usage
1815

19-
[dependencies]
20-
iced = { git = "https://github.com/iced-rs/iced.git" } # "0.13.0"
21-
```
16+
A very simple example using v0.13.0:
2217

2318
`src/main.rs`
2419

notes/language/rust/crates/rand.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ title: Rand
33
ref: https://rust-lang-nursery.github.io/rust-cookbook/algorithms/randomness.html
44
---
55

6-
## Usage
6+
## Install
77

8-
Utilities to generate random numbers in Rust.
8+
Generate random numbers.
99

1010
```shell
1111
cargo add rand
1212
```
1313

14+
## Usage
15+
1416
Generate a random number within a range:
1517

1618
```rust

notes/language/rust/crates/reqwest.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ title: Reqwest
33
ref: https://docs.rs/reqwest/latest/reqwest/index.html
44
---
55

6-
## Blocking
6+
## Install
77

8-
The simplest way to make a request is by making a blocking request.
8+
Make HTTP requests.
99

1010
```shell
11-
cargo add -F blocking reqwest
11+
cargo add -F blocking reqwest # For blocking requests
1212
```
1313

14-
Simple example using `v0.12.7`:
14+
## Blocking
15+
16+
Simple example using v0.12.7:
1517

1618
```rust
1719
fn main() -> Result<(), Box<dyn std::error::Error>> {

notes/language/rust/crates/serde_json.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@ title: Serde JSON
33
ref: https://docs.rs/serde_json/latest/serde_json/enum.Value.html
44
---
55

6-
## Untyped JSON
6+
## Install
7+
8+
Manipulate JSON.
79

810
```shell
911
cargo add serde_json
1012
```
1113

14+
## Untyped JSON
15+
1216
Instantiate a JSON:
1317

1418
```rust

0 commit comments

Comments
 (0)