fix: unnecessary space
This commit is contained in:
parent
de36f5cfb0
commit
81ea842fe7
|
@ -24,7 +24,7 @@ fn main() {
|
||||||
2. 🌟
|
2. 🌟
|
||||||
```rust,editable
|
```rust,editable
|
||||||
|
|
||||||
// Fill the blank
|
// Fill the blank
|
||||||
fn main() {
|
fn main() {
|
||||||
let v: u16 = 38_u8 as __;
|
let v: u16 = 38_u8 as __;
|
||||||
|
|
||||||
|
|
|
@ -240,7 +240,7 @@ Besides jump into the standard library, you can also jump to another module in t
|
||||||
// in lib.rs
|
// in lib.rs
|
||||||
|
|
||||||
mod a {
|
mod a {
|
||||||
/// Add four to the given value and return a [`Option`] type
|
/// Add four to the given value and return a [`Option`] type
|
||||||
/// [`crate::MySpecialFormatter`]
|
/// [`crate::MySpecialFormatter`]
|
||||||
pub fn add_four(x: i32) -> Option<i32> {
|
pub fn add_four(x: i32) -> Option<i32> {
|
||||||
Some(x + 4)
|
Some(x + 4)
|
||||||
|
|
|
@ -46,7 +46,7 @@ fn main() {
|
||||||
// A non-copy type.
|
// A non-copy type.
|
||||||
let movable = Box::new(3);
|
let movable = Box::new(3);
|
||||||
|
|
||||||
// A copy type would copy into the closure leaving the original untouched.
|
// A copy type would copy into the closure leaving the original untouched.
|
||||||
// A non-copy must move and so `movable` immediately moves into
|
// A non-copy must move and so `movable` immediately moves into
|
||||||
// the closure.
|
// the closure.
|
||||||
let consume = || {
|
let consume = || {
|
||||||
|
@ -55,7 +55,7 @@ fn main() {
|
||||||
};
|
};
|
||||||
|
|
||||||
consume();
|
consume();
|
||||||
// consume();
|
// consume();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn take<T>(_v: T) {
|
fn take<T>(_v: T) {
|
||||||
|
@ -68,7 +68,7 @@ fn main() {
|
||||||
// A non-copy type.
|
// A non-copy type.
|
||||||
let movable = Box::new(3);
|
let movable = Box::new(3);
|
||||||
|
|
||||||
// A copy type would copy into the closure leaving the original untouched.
|
// A copy type would copy into the closure leaving the original untouched.
|
||||||
// A non-copy must move and so `movable` immediately moves into
|
// A non-copy must move and so `movable` immediately moves into
|
||||||
// the closure.
|
// the closure.
|
||||||
let consume = || {
|
let consume = || {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
### 字符
|
### 字符
|
||||||
1. 🌟
|
1. 🌟
|
||||||
```rust,editable
|
```rust,editable
|
||||||
// 修改2处 `assert_eq!` 让代码工作
|
// 修改2处 `assert_eq!` 让代码工作
|
||||||
|
|
||||||
use std::mem::size_of_val;
|
use std::mem::size_of_val;
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -19,7 +19,7 @@ fn main() {
|
||||||
|
|
||||||
2. 🌟
|
2. 🌟
|
||||||
```rust,editable
|
```rust,editable
|
||||||
// 修改一行让代码正常打印
|
// 修改一行让代码正常打印
|
||||||
fn main() {
|
fn main() {
|
||||||
let c1 = "中";
|
let c1 = "中";
|
||||||
print_char(c1);
|
print_char(c1);
|
||||||
|
|
|
@ -34,7 +34,7 @@ fn main() {
|
||||||
|
|
||||||
```rust,editable
|
```rust,editable
|
||||||
|
|
||||||
// 修改 `assert_eq!` 让代码工作
|
// 修改 `assert_eq!` 让代码工作
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = 5;
|
let x = 5;
|
||||||
assert_eq!("u32".to_string(), type_of(&x));
|
assert_eq!("u32".to_string(), type_of(&x));
|
||||||
|
|
|
@ -205,7 +205,7 @@ pub fn add_three(x: i32) -> Option<i32> {
|
||||||
// in lib.rs
|
// in lib.rs
|
||||||
|
|
||||||
mod a {
|
mod a {
|
||||||
/// Add four to the given value and return a [`Option`] type
|
/// Add four to the given value and return a [`Option`] type
|
||||||
/// [`crate::MySpecialFormatter`]
|
/// [`crate::MySpecialFormatter`]
|
||||||
pub fn add_four(x: i32) -> Option<i32> {
|
pub fn add_four(x: i32) -> Option<i32> {
|
||||||
Some(x + 4)
|
Some(x + 4)
|
||||||
|
|
Loading…
Reference in New Issue