mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 20:49:41 +00:00
fix: unnecessary space
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
### Char
|
||||
1. 🌟
|
||||
```rust, editable
|
||||
```rust,editable
|
||||
|
||||
// Make it work
|
||||
use std::mem::size_of_val;
|
||||
@ -18,7 +18,7 @@ fn main() {
|
||||
```
|
||||
|
||||
2. 🌟
|
||||
```rust, editable
|
||||
```rust,editable
|
||||
|
||||
// Make it work
|
||||
fn main() {
|
||||
@ -33,7 +33,7 @@ fn print_char(c : char) {
|
||||
|
||||
### Bool
|
||||
3. 🌟
|
||||
```rust, editable
|
||||
```rust,editable
|
||||
|
||||
// Make println! work
|
||||
fn main() {
|
||||
@ -47,7 +47,7 @@ fn main() {
|
||||
```
|
||||
|
||||
4. 🌟
|
||||
```rust, editable
|
||||
```rust,editable
|
||||
|
||||
// Make it work
|
||||
fn main() {
|
||||
|
@ -335,7 +335,7 @@ The `impl Trait` syntax works for straightforward cases but is actually syntax s
|
||||
When working with generics, the type parameters often must use traits as bounds to stipulate what functionality a type implements.
|
||||
|
||||
7. 🌟🌟
|
||||
```rust, editable
|
||||
```rust,editable
|
||||
fn main() {
|
||||
assert_eq!(sum(1, 2), 3);
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ fn print_str(s: String) {
|
||||
```
|
||||
|
||||
5. 🌟🌟
|
||||
```rust, editable
|
||||
```rust,editable
|
||||
// Don't use clone ,use copy instead
|
||||
fn main() {
|
||||
let x = (1, 2, (), "hello".to_string());
|
||||
|
Reference in New Issue
Block a user