Comments (2)
Would be nice if we could collect some ideas of which topics/quirks to cover or, in general, what would be a reasonable approach to the overall topic of borrow checker patterns.
from patterns.
I feel like to fully understand borrow & checker, we should cover the following topics :
-
Explanation of Borrowing Rules: While Rust's borrowing rules are documented, it would be helpful to have more in-depth explanations and examples that show these rules in action.
-
Common Borrow Checker Errors: A guide to common borrow checker errors, their causes, and how to resolve them could be very helpful for new Rust developers.
-
Borrowing in Different Contexts: Borrowing behaves differently in different contexts (e.g., in struct fields, in loops, in closures). Each of these could be a topic of its own.
-
Patterns for Avoiding Borrow Checker Errors: Some coding patterns can help avoid borrow checker errors. For example, splitting functions, using Rc and RefCell for shared ownership, or using the Cow type for efficient cloning.
-
Understanding Lifetimes: Lifetimes are a crucial part of the borrow checker, but they can be confusing for newcomers. More resources on understanding and using lifetimes could be very valuable.
-
Move semantics: Lastly, we should also provide some materials with regard to the concept of move. Speak of this, I found rustlings exercise on move semantics very useful.
https://github.com/rust-lang/rustlings/tree/main/exercises/move_semantics
@simonsan What's your thoughts on this ?
from patterns.
Related Issues (20)
- Do you consider trait-to-extend as a anti-pattern HOT 2
- Clarify/Correct example of a dangling pointer in FFI/Passing-Strings
- To say that `new()` is not recommended when the type has a `Default` contradicts the official API guidelines HOT 1
- Rewrite RAII pattern article to adapt to OBRM terminology HOT 8
- Floating Point Related Idioms HOT 1
- Add double panic mentioning for RAII guards HOT 1
- Clarify parts of Lenses and Prisms chapter HOT 11
- Clarify paragraph in Generics as Type Classes
- Clarify naming convention of `build()` in section 3.2.1 HOT 1
- Design Patterns, Strategy has unclear identifier `Context` and `run` mentioned. HOT 1
- View type
- Translations HOT 6
- Incorrect text in Command pattern description
- Translation: Persian HOT 5
- Is this example wrong ? HOT 1
- Printing the book should not inherit theme colours HOT 1
- Extract code into runnable Rust files HOT 4
- Translate: Vietnamese HOT 2
- Typo in idioms/coercion-arguments.md HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from patterns.