I'm new Here
i need to Know how can i Mastering Rust Syntax so i know about Rustlings it was good i solve 14/94 exercises and i read about THE RUST PROGRAMMING LANGUAGE Book, Rust Docs is also good but i got difficulty to Understanding These Docs
But i need More Resources about how to mastering rust
if there is any guide to master Rust i will be Very Happy with That !
The short answer is, write Rust. Pick a project you want to work on, or maybe a library you want to learn, if you began learning with an objective in mind, start working towards it. If there is something specific you don't understand about the language, start building something that needs it.
I find that it's a lot more effective to learn something that you need to use right now, rather than cramming a bunch of stuff you'd have forgotten by the time you need it.
Also, use clippy, it will give you many good tips about what the conventions are and best practices.
This forum was also a HUGE help to me, if you have a specific question you'll get very good answers here, for the more basic stuff, most of it have already been answered if you search, I have a bunch of dumb questions with a lot of very good answers here.
I don't know about the best way, but the worst way would probably be trying to read and understand weird-exprs.rs - a test file in the Rust compiler that checks if compiler can parse and compile very questionable and ambiguous syntax.
I'm all for learning by doing. Of course start with reading The Rust Book and whatever else you can find. But I find it useful to try things out as you go. Not just cutting and pasting the examples and running them but also experimenting with them, change things here and there, see what breaks. And how it breaks.
A couple of tips:
Read the compiler error messages as you experiment. They may not make total sense at first but you will get used to it. There is a lot of useful information those error messages and warnings. Often the compiler will suggest how you can correct what you have done.
Do use an editor with Rust support. For example VSCode with rust-analyser extension installed. Although I use the Zed editor now a days: https://zed.dev/ The thing is that such an editor will:
a) Highlight syntax error as you type. No need to do endless recompiles as you progress.
b) Will show you the types of things produced by method calls and the like. Which I find very useful, saves a lot of hunting around in the documentation.
While we're at this, note that inline errors shown on editors are most often truncated. You will need to run cargo from command line in order to read the diagnostics in full.
Yes, sometimes a "cargo check" is helpful. It's very quick.
Also it often pays not to ignore warning messages. Many warnings can be ignored, at least temporarily, but sometimes there are very useful clues in there as to what is the cause of an actual error elsewhere.
In fact, that's exactly how I'm working through the The Book right now, and it's working very effectively. Modifying the examples can serve to reinforce understanding of the original code, as well as understanding of any new features and techniques that we incorporate. That strategy has also offered me essential practice with understanding error messages.
What might be helpful is working through an online Rust course like this one: Aalto FITech101 Courses. It explains things in its own way and has tons of nice little exercises to work though.