I Got error plz help


#1


#2

Did you forget match?

let guess: u32 = match guess.trim().parse() { ...};

Jan


#3

Ohh yaaa …Thnks


#4

i’m new to rust will you suggest any book to read other than docs . i think docs are littile bit hard.


#5

Have you tried the book?

Please from now on do not post screen-shots of code, they are not a good way to get other people interested in helping you. Maybe make a gist of the code you want to share.


#6

yaa i tried but it’s complex . and sorry for screen shots . but i don’t know what is gist ? , i wan’t to learn rust from the begining but in “the book” there is just a program’s and it’s explanation not complete referance like c or c++ .


#7

yaa i tried but it’s complex

You can cut&paste from your editor of choice (is that Emacs in the screenshot?). As long as the code is indented with at least 4 spaces it should work (like this):

let guess: u32 = match guess.trim().parse() {
        Ok(num) => num,
        Err(_) => continue,
};

#8

A gist is a piece of code, hostet on gist.GitHub.

It is easy to edit and reupload it so it is often used.

The service can also be used without registering.


#9

Do you use triple backticks? If you do so your code will be syntax highlighted.

```
fn main() {
println!(“Meow”);
}
```

Like this:

fn main() {
    println!("Meow");
}

This is also possible for other languages like C:

```c
int main(void)
{
printf(“Meow\n”);
}
```

Result:

int main(void)
{
    printf("Meow\n");
}

#10

Thank you ,no it’s VIM editor.


#11

i just use vim and set it’s color on , add some plugin’s and it’s cool for rust as IDE .


#12

Then you might want to have a look at the gist plugin for vim.


#13

On the first page of the book, there’s a paragraph that says:

After reading this introduction, you’ll want to dive into either ‘Learn Rust’
or ‘Syntax and Semantics’, depending on your preference: ‘Learn Rust’ if you
want to dive in with a project, or ‘Syntax and Semantics’ if you prefer to
start small, and learn a single concept thoroughly before moving onto the next.

It sounds like you might be looking for the Syntax and Semantics section. The book is written for many different learning styles.