cargo-expand
rental
cargo-expand | rental | |
---|---|---|
16 | 3 | |
2,435 | 211 | |
- | - | |
9.0 | 1.2 | |
14 days ago | about 3 years ago | |
Rust | Rust | |
Apache License 2.0 | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
cargo-expand
-
What is Rust doing behind the scenes?
It's been superseded by https://github.com/dtolnay/cargo-expand
-
Why dereferencing coercion is not used here?
Try installing cargo expand, it's useful to see how macros eventually get expanded. For example, if you run cargo expand on the following code
-
Procedural Macros are really hard to understand
You can use cargo expand to see what your code expands to: https://github.com/dtolnay/cargo-expand
-
[blog] Rust should own its debugger experience
Not too familiar with macros but does cargo-expand do what you want or did you mean something else?
-
Help me understand the borrowing and moving variable concept!
Yes. You can use Tools > Expand Macro on the playground or install and run cargo-expand to see what the macro expands to. It just adds a & before the argument.
- Advanced Metaprogramming in C: A select statement
-
How does declaring variables in macros work
cargo expand
-
How to see macro's source code in crate?
Along with what others are saying, there is also cargo expand which can show you what code a macro generates
-
How does Rust Python ffi work?
Something that may help you understand code with magic proc macros is this utility. It's basically a wrapper around a Rust compiler flag that allows you to expand macros for a file.
-
How does libtest know which functions are marked with #[test]?
You can use https://github.com/dtolnay/cargo-expand to examine how it works.
rental
-
Workaround for self-referential structs?
Before choosing rental, one should be aware that, according to a huge disclaimer on crates.io, rental is no longer maintained or supported. (The repository is archived.)
-
Things you can’t do in Rust (and what to do instead)
Overall this is a great blog post that highlights many of the things newcomers to Rust try out or are surprised why they are so hard and discouraged. One nit:
> Luckily there are some crates that take the solution and present a safe interface, such as the rental and once_self_cell crates.
Please don't link to the rental crate any more, as it's out of maintenance. The github repo is archived [0] and the maintainer explicitly stated they don't want to hand over maintenance to someone else. Thankfully the maintainer was still available to implement one tiny patch recently to make it not fire a future compat lint [1], but given this announcement by the maintainer, generally I'd recommend people to move to maintained alternatives. Especially new projects should build on something else. Instead of rental, the blog post could mention ouroboros. Also as a nit, the once_self_cell crate has been renamed to self_cell. There is also selfstack but I haven't used it so don't know how good it is.
[0]: https://github.com/jpernst/rental/commit/213671ab3aab3452efd...
[1]: https://github.com/rust-lang/rust/issues/84428
I agree with the general sentiment, and much of the stuff I build has little activity after an initial phase of getting it "done". However, I'm still around to merge important patches. But in the case of rental, the git repository is archived and most importantly the author has written that "users are encouraged to explore other solutions". Recently users of rental have been facing a future compat lint in rental, and thankfully the maintainer fixed it, but I think their intent of urging users to alternatives remains as immediately afterwards the repo got re-archived.
What are some alternatives?
saito-rust - A high-performance (reference) implementation of Saito in Rust
lol-html - Low output latency streaming HTML parser/rewriter with CSS selector-based API
proc-macro-workshop - Learn to write Rust procedural macros [Rust Latam conference, Montevideo Uruguay, March 2019]
wg - Coordination repository of the embedded devices Working Group
index-list - A doubly-linked list implementation in safe Rust using vector indexes
rust - Empowering everyone to build reliable and efficient software.
not-yet-awesome-embedded-rust - A collection of items that are not yet awesome in Embedded Rust
quote - Rust quasi-quoting
cargo-llvm-cov - Cargo subcommand to easily use LLVM source-based code coverage (-C instrument-coverage).
rustviz - Interactively Visualizing Ownership and Borrowing for Rust
cargo-edit - A utility for managing cargo dependencies from the command line.