Skip to content

Latest commit

 

History

History
75 lines (62 loc) · 2.44 KB

rust.org

File metadata and controls

75 lines (62 loc) · 2.44 KB

run-command recipe for RUST

Table of Contents

Commands

This recipes has 12+ commands, here some things which you can do using this recipe:
  • Install Dependecies of Cargo Project
  • Run Cargo Project (with release flag or without it)
  • Build Cargo Project (with release flag or without it)
  • Build Documentation for Cargo Project
  • Run Tests for Cargo Project
  • Update Dependecies for Cargo Project
  • Publish Cargo Project to https://crates.io
  • Lint code with clippy
  • Fix fixable warnings
  • Display the dependencies tree
  • Compile Rust File with rustc
  • Run Rust File with rustc

Customization

Detect Rust File

For detect rust file, run-command-recipes has variable run-command-recipes-rust-modes, which contains modes on which this recipes will work, defaults to:

  • rust-mode
  • rustic-mode

Also this recipe has function run-command-recipes-rust-mode-p. This is function, which return t, when current file is rust file (and it don’t take arguments!).

Detect Cargo Project

Variable run-command-recipes-rust-cargo-filename is file’s name of file, which if put in root directory, then say that current directional is cargo directory

Function run-command-recipes-rust-cargo-project-p don’t take arguments and return t, when now file is part of cargo project

Compile Command

rust-command-recipes-rust-rustc-compile-command is string, which is a shell command that compiles current Rust file using rustc. Defaults to:
rustc {file-name}

rust-command-recipes-rust-rustc-run-command is a string which is a shell command that run the current Rust file using rustc. Defaults to:

rustc {file-name} && {file-name-no-ext}

Executables

Also you can change paths to the executables of cargo and rustc using run-command-recipes-rust-cargo-executable and ~~run-command-recipes-rust-rustc-executable~~