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