Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/rust/00-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ Let's take a look over [`Cargo.toml`](Cargo.toml) first.

The most simple `Cargo.toml` will contains two parts:

- `package`: The metadata of this package like `name`, `version`
- `package`: The metadata of this package like `name`, `version`.
- `dependencies`: The dependencies that this package will depend on. `cargo` will download them from <https://crates.io> and compile them.

### `src/`

Than, let's read [`main.rs`](./src/main.rs).
Then, let's read [`main.rs`](./src/main.rs).

The most simple `main.rs` will contain only one function: `fn main()`, this is the entry of an application.

Expand All @@ -63,7 +63,7 @@ Declare our main function, this is the most simple function that not take any in
println!("Hello, {}", Scheme::S3)
```

- `println!()` is a built macro in rust to prints to the standard output, with a newline. macro will be expanded to real code during compilation.
- `println!()` is a built macro in rust to prints to the standard output, with a newline. Macro will be expanded to real code during compilation.
- `"Hello, {}", Scheme::S3` is the format string in rust. It will convert `Scheme::S3` to string, and construct a new string in this format.

## Build our first rust project!
Expand Down Expand Up @@ -91,7 +91,7 @@ Congrate! Our first rust project is built and running with success!
After built, we will find that there are some new files created:

- `Cargo.lock`: Cargo.lock is a file generated by the cargo package manager when you build or run a Rust project. It serves as a lock file and records the exact versions of dependencies that were used during the previous successful build or run of the project. It's always a good idea to commit `Cargo.lock` to your repo, so developers can reproduce the same build result with you.
- `target`: `target` folder is a directory automatically generated by rustc and managed cargo. It contains the compiled artifacts and build output for specific target platforms and architectures.
- `target`: `target` folder is a directory automatically generated by `rustc` and managed cargo. It contains the compiled artifacts and build output for specific target platforms and architectures.

## Conclusion

Expand Down
2 changes: 1 addition & 1 deletion examples/rust/01-init-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fn init_operator_via_builder() -> Result<Operator> {

We have a new concept here:

> `let mut builder = xxx;
> let mut builder = xxx;

The `mut` here means `mutable`, allowing its value to be changed later.

Expand Down
10 changes: 5 additions & 5 deletions examples/rust/02-async-io/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In this chapter's `Cargo.toml`, we add a new dependence `tokio`:
tokio = { version = "1", features = ["full"] }
```

The syntex is different from what we used before:
The syntax is different from what we used before:

```diff
- tokio = "1"
Expand Down Expand Up @@ -104,7 +104,7 @@ impl Operator {
}
```

`impl Into<Bytes>` here is a syntex suger of rust, we can expand it like the following:
`impl Into<Bytes>` here is a syntax sugar of rust, we can expand it like the following:

```rust
impl Operator {
Expand Down Expand Up @@ -159,9 +159,9 @@ This API will read all data from `path` and return as a `Vec<u8>`.

In this chapter we learnt a lot basic concepts in async rust! Now we have known that:

- How to setup tokio async runtime
- How to define and call an async function
- How to write and read data via OpenDAL
- How to setup tokio async runtime.
- How to define and call an async function.
- How to write and read data via OpenDAL.

## Challenge Time

Expand Down