/james_vs_borrow_checker

Some illustrations of github user jayber fighting the Rust borrow checker to either show solutions or get help

Primary LanguageRust

James vs the Borrow Checker

This is a repo full of examples from code I have written that cause compilation errors from the Rust borrow checker. In the hope that:

  1. Someone might help me fix them
  2. These examples and their solutions might help someone else

Because, even though sometimes the compiler tells you how to fix something, it's not always clear how this applies to your situation, or it tells you what is wrong but not how you should actually change your code to get it to work.

This is a workspace, containing a crate for each error. There is a minimal example for each in the main.rs file in the crate /src root, with the solutions, where I have any, in the /src/bin directory.

If you have better solutions, please submit PRs to the /bin directory for that specific error.

Thank you!