A guide to aid you in your journey of becoming a Rustacean (Rust developer).
โ A guide to aid you in your journey of becoming a Rustacean (Rust developer). See the Contributing and Code of Conduct for more information about how to contribute to this repository.
This guide is made by Glen De Cauwsemaecker and is in no way endorsed nor affiliated with the Rust foundation. Rust & Cargo are registered trademarks of the Rust foundation.
This guide is free and will remain gratis available to share for all who are interested or until the overlords at GitHub pull it down.
๐ This guide was featured on the front page of HackerNews on the 8th of April 2023 and in the weekly edition of the Rust newsletter on the 12th of April 2023.
Rust is a modern systems programming language with safety in mind as one of its core goals and strengths. Systems programming is programming within a resource constrained environment. However, as a lot of our services run now in paid-for-usage cloud environments, we can also consider them as resource constrained environments. This is why Rust is a great fit for more use cases then people might realize.
As it is a modern language and has taken the lessons from many other languages before it, it is also surprisingly pleasant to use once you get the hang of it. Its type system also allows expressive code that can help you exclude a great categories of bugs beyond the benefits that static typing can bring.
The goal of this guide is to introduce Rust to you as an individual or an entire organization. Should this not be sufficient you can also contact me for 1-on-1 coaching or workshops for your organization, by emailing me at [email protected]. More information on Glen can be found at https://glendc.com/.
This guide is fully open source and the complete source code can be found at https://github.com/plabayo/learn-rust-101. If you find any errors or have any suggestions, please open an issue or a pull request. If you want to contribute to this guide, please read the Contributing Guidelines. This guide is licensed under the MIT License and developed with love by Plabayo.
The origins of this guide can be found in the preparation of a semester long course I gave to a group of employees at OTA Insight Ltd.. The recordings of this course are available on YouTube at: https://www.youtube.com/playlist?list=PLQgXEsLXFxpVyLddG8FFXfNQEiodTzAjj.
This course is still actively being thought and the videos will be uploaded weekly when I find time to upload the recordings.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโดโโโโโโโโโโโ โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโโโบโ2. Learn More Rustโโโโโโโ โ
โ โ โโโโโโโโโโฌโโโโโโโโโโ โ โ
โ โโโโโโโดโโโโโโโโ โ โฒ โ โ
โ โ1. Learn Rustโ โ โ โ โ
โ โโโโฌโโโฌโโโโโโโโ โผ โ โ โ
โ โ โ โโโโโโโโโโโโโโดโโโโโโโ โ โ
โ โ โโโโโโโโโโโโโโโบโ3. Learn Async Rustโ โ โ
โ โ โโโโโโโโโโโฌโโโโโโโโโโ โ โ
โ โ โ โ โ
โ โ โ โ โ
โ โผ โผ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ4. Study Using the "Zero to Production in Rust" bookโโโโโค
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโ โ
โ โฒ โ โ
โ โ โ โ
โ โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ5. Contribute for the first time to an existing projectโโโโโ
โ โโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โ โ โผ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ 6. Study using the "Rust for Rustaceans" Book โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โฒ โ
โ โผ โ โผ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโค7. Contribute an advanced feature or start your own projectโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ 8. Continue to Learn โ
โโโโโโโโโโโโโโโโโโโโโโโโ
Continuously Learn, Take Your Time
Enjoy the road :)
The above paths are just a suggestion and also should make clear that there are many ways and approaches to using this guide. Most important is that you do enjoy the journey and that you learn consistently (e.g. ~ X hours per week). How you'll walk the path and how often you revisit things will depend on your learning style and capabilities. There are however no wrong ways to go. E.g. maybe you want to dive into some code yourself as soon as possible and only then will start covering foundations. Or perhaps you first wanna feel very comfortable to only then start really coding yourself once you think you understand the foundations well. All up to you really.
Only thing I would really want to hammer on is to do a lot of coding yourself. The best way to learn is to do. So don't be afraid to make mistakes and to try things out. You'll learn a lot more that way. It will be a very confronting journey but it will be worth it. If all you do is read and read you'll never really get a feel for the language and you'll never really get a feel for what you can do with it. So please, do a lot of coding yourself. Plus at times we can trick our brain into thinking we understand something when we don't.
Also even if you start to reach advanced topics (e.g. Rust for Rustaceans), it is still very important to keep doing the basics. You'll be surprised how quickly you can forget things. So keep doing the basics and keep doing the advanced topics. It is a never ending journey.
You'll notice when reading this guide that there are often alternatives mentioned or several layers of difficulty. With this in mind it might very well be your choice to go through a section shallow to start, going through the basic/foundational material, to then come back to it after having gone through other sections already with more experience at your belt. At this point you might have more confidence to get to the more advanced material of the section or have gained the background or mindset to understand that content and get more out of it. The spatial repetition as a result is on top of this all an excellent way to slowly but surely mold your grey mass into the desired shape.
In case you are not planning to work on a project anytime soon that requires Async programming. Feel free to skip that section for the time being should it be the case. For now just know that official Async support in Rust exists and that it has an important place within the Rust ecosystem. You can always come (back) to it at a future point when you do decide or realize that strong foundations in this section can help out.
If you ever feel stuck, or want a guide, teacher or mentor. Feel free to reach out to Glen at [email protected] to book a 1-on-1 session or a workshop for your organization. It can be a one time thing or we can meet regularly to help you along the way.
Support this project by becoming a sponsor.
Glen De Cauwsemaecker created this Educational track to help you get started with Rust from an absolute beginner all the way until you're an expert in it. He is open to mentor people, lead workshops and more. If you're a team lead that wants to introduce Rust to their team, feel free to talk to him. Glen started with Rust around 2015, when Rust was still unstable and fast moving. Coming from a C++ background in a system programming job the benefits were immediately clear to him. In the meanwhile things have changed a lot and many companies have been starting to adopt Rust in their toolset:
The language and its ecosystem have also very matured. Concepts like Async have also landed and Async runtimes such as Tokio have become stable and can be used without fear. While it was harder to convince companies to jump on the Rust wagon in the past, by now it should be a lot easier to sell. Is it one language to replace them all? Of course not, but neither should it be overlooked. Are you not sure how Rust might benefit your team for one thing or another? Contact Glen and figure it out together.
If you are a bit of a history nerd you might also enjoy:
There's a last section on the end of the Rust learning content. This one contains useful references and sources that you can check as part of your continuous journey as a capable Rust developer.
In case you are a Python or Javascript developer you might find the Appendix V. Python / Javascript developers section useful.
In case you're new to the language we suggest you to take a look at Learn Rust (free):
Sooner or later you might also need help for a project you work on or simply to learn a concept you do not really understand. Not everybody has a senior or friend around that can help them out with this. For all of this and more you want to probably join one or multiple of the community chat servers listed in Appendix VII. Community Chat.
โ Hardcore alternative
Programming Rust, 2nd Edition (O'Reilly Publishing) is a big book and will take you some time to get through. It is not for the faint of heart. Howeverโฆ If you do choose for this route as an alternative to (1) Learn Rust, you will absolutely not regret it. In fact, your entire rest of the Journey will be a breeze.
The "Programming Rust, 2nd Edition" book is a gem and in case you can handle big dry Technical books such as these it is one that will give you just as much love back as the energy that you put into it. Take your time, get through it, play with it, and enjoy. In fact, it can be easily paired with Rustlings by doing the exercises linked to the content you're reading. Rust by Example can also be added on top of that to see some more code related to the stuff your learning.
Soak it in. It's a hardcore alternative, but if you're up for it, it's there for you to grab.
If you've never done any Systems programming before, this will be an especially helpful book given it will explain a lot of the magic you've encountered in your very protected professional life so far. You're welcome.
Questions you should be able to answer at the end of this step:
Welcome to Comprehensive Rust ๐ฆ - Comprehensive Rust ๐ฆ: a small bootcamp course by Google focussed on Android Engineers. Most of it is however applicable to anyone coming to Rust from another language and could be a great alternative or companion for some of the resources above.
Questions you should be able to answer at the end of this step:
Once you went through the resources in the previous two chapters you might want to start working on a real project to start applying and solidifying your knowledge. A classic way to do this is by porting a small specialized codebase from one language to Rust, keeping in mind to not 1-to-1 map the lines of code but to instead focus on porting the logic with the "Rust way to do things" in mind.
Should you want some inspiration or a more guided approach, here are some resources that could help you out with this extra optional, but recommended step:
If you have a lot of free time at your hand and you want to build something really cool that is totally useless, here are some more ideas:
Seriously though, do not consider the above recommended or mandatory in any way. If you however really like to develop stuff and you do like to do it extensively in your free time, then, and only then, I do believe that the above are a great way to really solidify your current Rust knowledge and give yourself a great (pragmatic) foundation.
At this point of your Rust learning journey you've come a far way already, relatively speaking. Perhaps you want to shortcut, at least for now.
If so, the still to be published "Code like a pro in Rust" book might be enough for you to quickly get from beginner to advanced Rust programmer.
Once you get at this point you are around the level of a beginner or intermediate Rust programmer. At this point you could already start to tackle stuff like "Rust for Rustaceans" of step (6). However it might be a bit much.
Therefore while you go through the next couple of sections it could be helpful to now and then (e.g. while washing dishes or instead of Netflix) an education Rust code video. In the appendix at the bottom of this page there a couple of such suggestions.
Particular to this context you might want to save the "Crust of Rust" playlist. Each video will go over a specific topic, e.g. Lifetimes, macros, Atomics, โฆ No need to watch them one by one, feel free to jump to them in whatever orders and only those that interest you (which is the same tip that I can give for the "Rust for Rustaceans" book).
Designing APIs is a big part of being a Rust programmer, any programmer really. Once you start to get comfortable enough in Rust or start building your own public crate, it is a topic you'll want to invest in.
A good starting point is the API Guidelines which are a set of guidelines that are meant to help you design good APIs. They are not meant to be followed blindly, but rather to be used as a reference to help you make the right decisions.
A next and continuos step is to read blog posts and watch videos about API design. The Rust newsletter often has an article listed in its weekly edition. But other platforms such as HackerNews will have interesting Rust articles pop up as well. https://sabrinajewson.org/blog/errors is for example a great article talking about one might to give errors as much love as the other parts of the API, and also talks about why crates like thiserror
might nog be that great. All in all, similar to other parts of your continuous Rust learning journey, you'll want to remain critical and open to new ideas and see what works for you and what not.
There is no standard / official Asynchronous runtime. This in contrast to actual CPU threads which you can create from within the std library.
The most popular and recommended by many Async Runtime is the Tokio runtime. Which brings us to the next chapter:
Please also join the Tokio Discord community as part of your async Journey, a place where you can ask any questions you want as well: https://discord.com/invite/tokio. This server also has also individual channels for the different projects in the Tokio ecosystem such as Hyper, Axum, Tower and more. The maintainers of the different projects are also very active in the server and are happy to help you out, but of course please do not take this for granted. Be respectful and if possible contribute back to the community as well.
As an extra you may also want to read and develop alongside the following articles:
In order to help you understand how Async code works (e.g. what about the Async keyword and How do futures really work. And how do you define traits with futures. And How do you implement them), you might want to read through the articles linked in the Tower section, as seeing how to implement your own Tower middleware might answer many of such questions. Gaining a deeper theoretical but still pragmatic enough understanding behind it is probably better done by reading some of the books listed in this guide.
โ Note: Tokio also provides support to the new Linux kernel io_uring concept, a new powerful way to allow async programming on Linux. Support for it can be found at: GitHub - tokio-rs/tokio-uring: An io_uring backed runtime for Rust
Synacktiv made an IO network scanner using io_uring as can be seen at GitHub - synacktiv/io_uring_scanner: io_uring based network scanner written in Rust, using tokio's low level userspace bindings to io_uring.
To get a better idea about how futures work and the executor which polls them, you might want to read this article: https://bertptrs.nl/2023/04/27/how-does-async-rust-work.html.
Questions you should be able to answer at the end of this step:
Please do remember that Async programming is only beneficial to optimize the idle time of your threads away. For tasks where you already near 100% utilize your threads (e.g. computation heavy algorithms) something like async will not help you and will in fact make your codebase a lot more complex and difficult to reasons about.
Should you have computation-heavy algorithms which you want to paralyze you can achieve that by making use of threading alone. A crate such as https://docs.rs/rayon/latest/rayon/ might help you a lot with this as well.
Once you step into the world of Async Rust, Tokio and Web Services you'll sooner or later come across Tower, in a similar fashion as Serde blew your mind away for your serialization needs. Yes it did, you can admit it, this is a safe space.
โ Tower is a library of modular and reusable components for building robust networking clients and servers.
With Tower everything is a service. A service takes in a request and outputs either an error or a response. What the actual types for these request-response pairs are, is up to you and depend mostly on the layer it is used.
In tower it is typical that a service wraps another service, called "layers", as such all your services and middleware will stack on top of each other, like a... tower.
Understanding concurrency, the primitives used to do so safely and how it all works "under the hood" (e.g. the OS level) is not critical but it will help you big time the rest of your Async professional career.
The book "Rust Atomics and Locks" by O'Reilly is an amazingly good book by Mara Bos, an important Rust Contributor. Going through the book will take you some time despite its smaller size, but doing so is very rewarding. As with any technical book it is best to read this book as well as do its exercises and apply its knowledge using one program or another. Learn, Apply, Repeat. Play with it, Understand it.
This book is so good, that even Go, Python or JS developers that will never ever touch Rust, might want to learn Rust just to understand the knowledge that can be found in this Gem of a book. Read it. You won't regret it.
As it is more advanced knowledge it can however be seen as "Extra", so in case you are in a hurry to finish section (3) of the Rust track, feel free to skip it. But even if so, keep its existence in mind and come perhaps back to it when you start to get yourself into trouble.
Questions you should be able to answer at the end of this extra step:
The next sections are all optional and are not required to really be productive in Rust. Some of it are alternative resources or extra content to learn from. Others is just miscellaneous content that is not really required to be productive in Rust, but might be interesting to you.
This guide is either way not meant to be read in a single session or series. Take it as yours and just use it as part of your learning journey. Take your time as learning Rust isn't easy, but it is a very rewarding one once you did climb the mountain and are dancing with a double rainbow in the background.
Go through the entire book, filling any gaps you might still have and do all the exercises as well.
At the end of the book you should be able to present your own GitHub or GitLab hosted projected based on the exercises and projects of the books, where you applied all your knowledge and also put in something of yourself in it.
โ Backend frameworks like Rocket and Actix are pretty commonly used in books. However know that the Axum framework is currently probably your best best if you need to choose a backend framework for your next or current Rust project.
Learning Axum in specific could be done by following tutorials such as https://github.com/jeremychone-channel/rust-axum-course, which seem pretty complete and focussed.
Given how much Axum is built with Tower in mind, you probably also want to learn that.
Questions you should be able to answer at the end of this step:
Contribute to an open source project that you like or may want to strongly depend upon in the future.
Many projects have a good first issue
label, which is a good place to start. You can also look for issues that are labeled help wanted
or easy
.
There's also the Rust Mentorship program, which pairs up new contributors with experienced Rustaceans. You can find more information about it at: https://rustbeginners.github.io/awesome-rust-mentors/
In The weekly Rust Newsletter you can find a list of projects that are looking for contributors.
If you are a seasoned programmer already you might also opt to already start making your own new project or porting a scoped project from another language to Rust.
Go through the entire book, getting a deep(er) understanding of the advanced concepts and inner workings of them.
At the end of the book you should be able to present your own GitHub or GitLab hosted projected based on the exercises and projects of the books, where you applied all your knowledge and also put in something of yourself in it.
Questions you should be able to answer at the end of this step:
Start a project for yourself, your dog, your organization or mother. This might be a microservice, library or small tool. Everything is possible.
Another option is to contribute to an open source project that you like or may want to strongly depend upon in the future.
See section (5) about your first contribution for some inspiration on where to start.
As it is assumed that at this point you are doing intermediate level work in Rust it will be the case that sooner or later you'll need to debug. Or perhaps you are about to deploy your own small project to production. In any case, you'll need to know how to debug Rust applications. You can read all about this and tracing in Appendix VIII. Debugging Rust.
If you have completed all the steps above, you have done more then enough and can call yourself a Rustacean. You can now start to contribute to the Rust ecosystem and help others to learn Rust. Perhaps more importantly, you have all the knowledge you need to build your own projects in Rust.
What you'll build depends on your interest or perhaps in the type of industry or company you're working in.
There's a lot more of course. You probably know best where you're going. A lot of exciting stuff is happening. Plenty of conferences (e.g. Rust Conf) to help you get inspired on it if you're not already. And of course, plenty of people to help you out if you get stuck. So, good luck and have fun!
In order to start using Rust you have to install and configure its tooling on your machinery.
rustc
), standard library and tooling (e.g. cargo
) are all managed using rustup
.
rustup update
With this installed you should now be able to run the following command:
cargo version
Which will output something like:
cargo 1.67.1 (8ecd4f20a 2023-01-10)
You can learn to create, compile and run your first Rust program at "First Steps with Cargo - The Cargo Book".
clippy
using rustup component add clippy
cargo clippy
to help guarantee the quality of your coderustfmt
using rustup component add rustfmt
cargo fmt
to format your code (best to also configure this in your IDE to be done each time you save the file)No custom linting configurations are agreements are required. If you use these two tools, you're golden. These tools also work nicely with any IDE you might use. Within your CI environment these same tools will be used to check that your code adheres to its standards.
โ WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications.
WebAssembly on itself is completely isolated from Rust, but it must be said that among the WASM community, the Rust part is probably the biggest and most active one. Compiling Rust to WASM is a true pleasure and allows for browser client code to be written in Rust, be it a small library to be used from JS or an entire web client. WASM projects can also be used to quickly deploy web services (in the backend). These are similar to lambda functions but are even faster to use and in a way also safer.
Frameworks that you might want to check if you want to make a front-end (web) app using Rust:
Run WASM Backend Services in the cloud:
As you can see, WASM on the backend it is a thing. Wether it's more then just hype is something the future will tell, but either way a lot of interesting stuff is happening and there's big money behind it somehow. So you might as well jump on the car, especially if you missed the Docker train somehow. Happens.
Native apps are applications written for a specific platform. While that could be any platform, it usually refers to anything that is not the "web" and even more so, these days, it pretty much always refers to Desktop, Mobile or the combination of. Cross platform apps mean that multiple platforms are supported, which could be any set of web or non-web platforms.
Tauri is the toolset you want to check out if you want to build native apps with a Gui in Rust. You can find all information about it on their official website: https://tauri.app/
โ Build an optimized, secure, and frontend-independent application for multi-platform deployment.
Tauri applications can be compared to Electron, but it uses a very different approach. Multiple rendering engines are supported, with web view like rendering engines being the default. But this is still different then shipping a Node runtime and Chromium with each and one of your apps. Meaning your desktop applications can be as small as a couple of megabytes, compared to the usually bloated 150MB apps. And once running they will also be a lot less resource hungry compared to your topical Electron app.
Mobile applications are not yet officially supported, but they will soon get support as well, as the underlying technology for it is already more or less ready.
In case you want to write applications that work on both the web and a non-web platform you can achieve this by splitting of your business logic from your minimal front-end logic, such that you can write one front-end in any of the available front-end approaches (e.g. leptos or perseus) and another one using Tauri, with most of your code being available as one or more Rust libraries.
The front-end logic can be written using any web application front-end framework, e.g. Svelte.
You can also opt to go fully native by using plugins such as tauri-egui: https://github.com/tauri-apps/tauri-egui
As with any (new) language, there's no point in replacing every existing technology written before, with a new implementation written in Rust. While at times there are benefits such as with ripgrep instead of grep, this is not a generally useful strategy not a desired one.
At times however you might be able to incorporate the benefits of Rust in your existing benefits without having to expose the language to anyone:
These give just a small taste of what Rust can mean for Web developers even if they do not know or use Rust themselves directly.
A language is a tool, but a tool is not to be applied to any problem. Rust has its advantages and use cases, it would be foolish not to use it where desirable.
In case you come from Python or Javascript you can alternatively replace the first four steps of this learning guide with a single book. Rust Web Programming (Packt Publishing) aims to get web developers (including Python developers) get started with Rust and has a very pragmatic approach.
Given how important Async is in our work environment it is still worth to go through section (3) "Learn Async Rust" to make sure you do really grasp that very well. It is also where a lot of your Rust knowledge starts to come together, so if you get that you know you're on the right track.
Should you after completing this book (even if partly) want to have some more hands on experience you can opt to never the less do section (4) as well and go through the "Zero to Production in Rust" book
However, in case you are confident you did get all the foundational concepts of Rust and want to just develop stuff already and get it "into your fingers" you might want to opt to after this (and before jumping onto section (5)) read "Rust In Action" first. It gives a lot of fun things to build. Alternatively you can check the "Learn More Rust: Extra" part of section (2) Learn more Rust, where we also go over many ideas for you to get more experience and help you solidify your Rust knowledge.
The "Rust in Action" book can also be seen as yet another alternative all together, as it is also aimed at introducing Rust to people who never did any Systems programming, So you could also do it instead of the Rust Web Programming book.
Learning to master a language has a beginning but it doesn't have an ending. You'll want to continue to learn, teach others and keep up to date. In this appendix you'll find material to help you with all this and more.
Official Blogs:
Conferences:
Podcasts:
Actuality:
community curated crate lists:
Free Rust Resources that we haven't mentioned yet, but are great to read at one point or another:
If you learn by doing and haven't gotten enough from the resources we linked already in "Learn more Rust", here are some more tips:
A blog you might want to RSS subscribe to is Amos's his blog which is always fun to read, be it sometimes a bit heavy: https://fasterthanli.me/tags/rust/
A nice reference sheet if you need one can be found at: https://cheats.rs/
Learning from and working with a community is one of the many perks of Rust, which is rightfully known for its warm, inclusive and charming community. Always open and friendly to others.
Here are some chat servers you can join to interact with this fantastic community reward. All of them are great places to meet other Rust developers, find help, share news or a project and also to give back to the community yourself:
There are others of course but these are the one which are both active, inclusive, friendly and known to the authors of this guide as being a great place to be and be part of.
Debugging Rust code can be seen on three different levels:
Underappreciated is point (1). Ensuring that impossible state and behavior is in fact impossible at compile team and thus guaranteed by the compiler is a big class of errors that you simply can no longer make and thus never have to debug. Using maker types and enums can help you a lot here.
Rust is also a typed language so ensuring to use the proper types and use them consistently, will also help avoid a big category of bugs. Similarly, you probably do not really ever want to unwrap/expect any of your library code and only do so at the very top level, as to avoid nasty edge cases at runtime.
That being said, sometimes things do go wrong. And debugging in production is not always fun. In fact, trying to reproduce rare scenarios locally is even less fun. For that you really want to ensure you know the right tools and crates to help you deal with point (2).
tracing
crate and its mini ecosystem will be your friend, to help you define logs, metrics and more.
Finally when shit really hits the fan, and you do not see what's wrong from metrics and logs (alone), you might need to grab to a debugger. The book https://rustc-dev-guide.rust-lang.org/debugging-support-in-rustc.html might be able to give you a good starting point. Articles such as https://dev.to/rogertorres/debugging-rust-with-vs-code-11dj might help you get started on debugging in case you are using VScode for Rust, which is what plenty of people seem to use these days. There's also a Gist about it for VSCode at https://gist.github.com/xanathar/c7c83e6d53b72dd4464f695607012629.