Rust Snippets
Rust snippets for the Zed IDE. A collection of Rust snippets to improve your development speed.
Snippets
How to install
With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.
You can also open the Extensions panel in the app and search for Rust Snippets. The extension's id is rust-snippets.
Don't have Forge Super yet? Download it here.
README
From the extension's repository, written by its authors and not by Mentenaz. See the source.
Rust Snippets for Zed
Installation
- Clone this repo:
git clone https://github.com/bobbymannino/rust-snippets-for-zed
- Go to the Extensions menu in the Zed IDE
- Click "Install Dev Extension"
- Select the folder you cloned
Available Snippets
let-vecInitialize an immutable vecmut-vecInitialize a mutable vecmatch-optionMatch an option statementmatch-resultMatch a result statementif-someIf let Some pattern matchingclone-structClone structdebug-structDebug structclone-and-debug-structClone and debug structwin-onlyA Windows only derivemac-onlyA macOS only derivelinux-onlyA Linux only deriveios-onlyAn iOS only deriveandroid-onlyAn Android only deriveif-okIf let Ok pattern matchinglet-elseLet else binding with early returnwhile-someWhile let Some loopfor-inFor loop over an iteratorfnA functionasync-fnAn async functionpub-fnA public functionpub-async-fnA public async functionimplAn impl blockimpl-traitImplement a trait for a typefn-newA new() constructorimpl-defaultImplement Default for a typeimpl-displayImplement Display for a typeimpl-fromImplement From for a typetraitA trait definitionenumAn enum definitionmatchA match statementtestA test functiontest-modA tests modulemainThe main functionserde-structA serializable and deserializable structderive-allDerive the common traitshash-mapInitialize a mutable HashMaphash-setInitialize a mutable HashSetunsafeAn unsafe blockallowAllow a lint