Skip to content

Commit

Permalink
docs: fix grammar and spelling in Markdown in examples/rust (#4241)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbampton authored Feb 22, 2024
1 parent 3868130 commit d61e637
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions examples/rust/00-setup/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Chapter-00: Set up Your First Rust Project

Welcome to our first chapter. In this example we will set up our first rust project with OpenDAL.
Welcome to our first chapter. In this example we will set up our first Rust project with OpenDAL.

## Install Rust

First of all, we need to install Rust. Refer [here](../../../CONTRIBUTING.md#bring-your-own-toolbox) to figure it out.

After rust has been installed, we will have the following components:
After Rust has been installed, we will have the following components:

- `rustup`: [rustup](https://rust-lang.github.io/rustup/) is a command-line toolchain manager for the Rust programming language. It allows you to easily install, manage, and update different versions of the Rust compiler and associated tools on your system.
- `cargo`: [cargo](https://doc.rust-lang.org/cargo/index.html) is the package manager and build system for the Rust programming language. It is designed to make it easy to develop, build, and manage Rust projects.
Expand All @@ -26,7 +26,7 @@ A typical Rust project follows a specific directory structure. The most simple p
- `Cargo.toml`: The Cargo.toml file is the manifest file for the project. It specifies metadata about the project, including its name, version, dependencies, and build configuration. It is also where you declare the project's dependencies using the Cargo package manager.
- `src/`: The `src` directory is where the main source code files of the project reside. It typically contains the Rust source files with the code implementation for the project's functionality.

Let's go into more deep by our example code.
Let's go into more depth by our example code.

### `Cargo.toml`

Expand Down Expand Up @@ -86,7 +86,7 @@ We will see output like:
Hello, s3
```

Congrate! Our first rust project is built and running with success!
Congrats! Our first Rust project is built and running with success!

After built, we will find that there are some new files created:

Expand All @@ -95,4 +95,4 @@ After built, we will find that there are some new files created:

## Conclusion

In this chapter we have learnt the rust project structure and run our first rust example. We will use this knowledge to build our first rust application in the next chapter!
In this chapter we have learnt the Rust project structure and run our first Rust example. We will use this knowledge to build our first Rust application in the next chapter!
12 changes: 6 additions & 6 deletions examples/rust/01-init-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ fn main() -> Result<()> {

> `use opendal::Result;`
imports opendal's `Result` which will shadows rust built-in result.
imports opendal's `Result` which will shadows Rust built-in result.

> `fn main() -> Result<()>`
The way that rust to declare returning types of a function. This case means `main` will return a `Result` which holds `()`.
The way that Rust to declare returning types of a function. This case means `main` will return a `Result` which holds `()`.

> `()`
Expand All @@ -85,7 +85,7 @@ let op = init_operator_via_builder()?;
- `xxx()` means call function that named `xxx`.
- the `?` is a syntax sugar in Rust that checks if the returned `Result` is an `Err`. If it is, then it immediately returns that error. Otherwise, it returns the value of `Ok`.

So this line will call `init_operator_via_builder` function first and set to variable `op` if it's returns `Ok`.
So this line will call `init_operator_via_builder` function first and set to variable `op` if it returns `Ok`.

## Initiate Via Builder

Expand Down Expand Up @@ -157,12 +157,12 @@ Please feel free to try initiating other services or configuring new settings fo
## Conclusion
In this chapter we learnt a lot basic concepts in rust! Now we have known that:
In this chapter we learnt a lot of basic concepts in Rust! Now we know:
- How to define a function that returns something.
- How to declare an immutable variable.
- How to call functions in Rust.
- How to define and use enums.
- How to handling result.
- How to handle results.
With our newly acquired rust skills, we can initiate the OpenDAL Operator in two main ways. This knowledge will be used to read and write data to storage in the next chapter!
With our newly acquired Rust skills, we can initiate the OpenDAL Operator in two main ways. This knowledge will be used to read and write data to storage in the next chapter!
4 changes: 2 additions & 2 deletions examples/rust/02-async-io/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Chapter-02: Async IO

In [Chapter-01](../01-init-operator/README.md), we learnt how to initiate an `Operator`. All operations in OpenDAL is IO bound which means most of our users will use OpenDAL in an async runtime. This chapter will discuss how to call `Operator` in async runtime and how to use OpenDAL to read and write data!
In [Chapter-01](../01-init-operator/README.md), we learnt how to initiate an `Operator`. All operations in OpenDAL are IO bound which means most of our users will use OpenDAL in an async runtime. This chapter will discuss how to call `Operator` in async runtime and how to use OpenDAL to read and write data!

## Warmup

Expand Down Expand Up @@ -115,7 +115,7 @@ impl Operator {

This API means it accepts any types that implements `Into<Bytes>`. `Bytes` is provided by [`bytes::Bytes`](https://docs.rs/bytes/latest/bytes/struct.Bytes.html), we can find all types that implements `Into<Bytes>` here.

So we can also calling `write` on:
So we can also call `write` on:

- `Vec<u8>`
- `String`
Expand Down

0 comments on commit d61e637

Please sign in to comment.