diff options
author | David Knaack <davidkna@users.noreply.github.com> | 2021-02-11 21:34:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 21:34:47 +0100 |
commit | eccbda8328159adbb261112cba285d1f63ae29e7 (patch) | |
tree | 7c0311bada5fb13f96e2ad7f6da601b322b54dbf /CONTRIBUTING.md | |
parent | 04d1332f9cffda9d0271ad99ac50bec17e918eaf (diff) |
feat: allow changing default command timeout (#2283)
* feat: allow changing default command timeout
* fix clippy
* add doc to exec_cmd in Context
* update docs in CONTRIBUTING.md
* Fix comment in CONTRIBUTING.md
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r-- | CONTRIBUTING.md | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 314908a8f..0a0a23de0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,7 +37,6 @@ use super::{Context, Module, RootModuleConfig}; use crate::configs::php::PhpConfig; use crate::formatter::StringFormatter; -use crate::utils; pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> { @@ -51,20 +50,19 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> { ## External commands -To run a external command (e.g. to get the version of a tool) and to allow for mocking use the `utils::exec_cmd` function. Here's a quick example: +To run a external command (e.g. to get the version of a tool) and to allow for mocking use the `context.exec_cmd` function. Here's a quick example: ```rust use super::{Context, Module, RootModuleConfig}; use crate::configs::php::PhpConfig; use crate::formatter::StringFormatter; -use crate::utils; pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> { - // Here `my_env_var` will be either the stdout of the called command or the function + // Here `output` will be either the stdout of the called command or the function // will exit if the called program was not installed or could not be run. - let output = utils::exec_cmd("my_command", &["first_arg", "second_arg"])?.stdout; + let output = context.exec_cmd("my_command", &["first_arg", "second_arg"])?.stdout; // Then you can happily use the output } |