format code in md

This commit is contained in:
likzn
2022-05-01 13:08:50 +08:00
parent dad4052485
commit e09080f88a
43 changed files with 405 additions and 124 deletions

View File

@ -2,13 +2,14 @@
2. `cargo new --lib hello-package1`
3. `hello-package` has a binary crate named `hello-package`, `src/main.rs` is the crate root.
3. `hello-package` has a binary crate named `hello-package`, `src/main.rs` is the crate root.
`hello-pacakge1` has a library crate named `hello-package1`, `src/lib.rs` is the crate root.
4. `hello-package1`
5.
```shell
# FILL in the blanks
.
@ -20,6 +21,7 @@
```
6.
```shell
# Create a package which contains
# 1. three binary crates: `hello-package`, `main1` and `main2`

View File

@ -1,4 +1,5 @@
1.
```rust
// in lib.rs
mod front_of_house {
@ -21,6 +22,7 @@ mod front_of_house {
```
2.
```rust
// in lib.rs
pub mod front_of_house {
@ -53,6 +55,7 @@ pub fn eat_at_restaurant() {
```
3.
```rust
mod back_of_house {
fn fix_incorrect_order() {
@ -75,9 +78,8 @@ mod back_of_house {
}
```
4.
```rust
// in src/lib.rs
@ -104,7 +106,6 @@ pub fn fix_incorrect_order() {
pub fn cook_order() {}
```
```rust
// in src/front_of_house/mod.rs
@ -136,8 +137,8 @@ pub fn take_payment() {}
fn complain() {}
```
5.
```rust
mod front_of_house;

View File

@ -1,4 +1,5 @@
1.
```rust
use std::fmt::Result;
use std::io::Result as IoResult;
@ -7,6 +8,7 @@ fn main() {}
```
2.
```rust
use std::collections::*;
@ -29,8 +31,8 @@ fn main() {
}
```
3.
3.
```rust
// in lib.rs