aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/pre_commit.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-01 17:51:35 +0000
committerGitHub <[email protected]>2021-03-01 17:51:35 +0000
commit5efb7f85eb24c7ad76136a7d81e8f8cffe213aa8 (patch)
tree0795d7277733920361a260db1a65306f1a47e1ac /xtask/src/pre_commit.rs
parentc17f2bf2a27798858ef2e3012ca28295aed46efa (diff)
parentd9dcfd81c5d4325379ac88c4250b9c77ecbd75e8 (diff)
Merge #7830
7830: Simplify xtask r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'xtask/src/pre_commit.rs')
-rw-r--r--xtask/src/pre_commit.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/xtask/src/pre_commit.rs b/xtask/src/pre_commit.rs
index 8f2dbea19..b57cf3ce2 100644
--- a/xtask/src/pre_commit.rs
+++ b/xtask/src/pre_commit.rs
@@ -9,7 +9,7 @@ use crate::{project_root, run_rustfmt, Mode};
9 9
10// FIXME: if there are changed `.ts` files, also reformat TypeScript (by 10// FIXME: if there are changed `.ts` files, also reformat TypeScript (by
11// shelling out to `npm fmt`). 11// shelling out to `npm fmt`).
12pub fn run_hook() -> Result<()> { 12pub(crate) fn run_hook() -> Result<()> {
13 run_rustfmt(Mode::Overwrite)?; 13 run_rustfmt(Mode::Overwrite)?;
14 14
15 let diff = cmd!("git diff --diff-filter=MAR --name-only --cached").read()?; 15 let diff = cmd!("git diff --diff-filter=MAR --name-only --cached").read()?;
@@ -23,7 +23,7 @@ pub fn run_hook() -> Result<()> {
23 Ok(()) 23 Ok(())
24} 24}
25 25
26pub fn install_hook() -> Result<()> { 26pub(crate) fn install_hook() -> Result<()> {
27 let hook_path: PathBuf = 27 let hook_path: PathBuf =
28 format!("./.git/hooks/pre-commit{}", std::env::consts::EXE_SUFFIX).into(); 28 format!("./.git/hooks/pre-commit{}", std::env::consts::EXE_SUFFIX).into();
29 29