From 6c969c02d21ce2814d78c8a0244403f24f5eb50d Mon Sep 17 00:00:00 2001 From: sneivandt Date: Sat, 20 Jul 2024 10:46:39 -0700 Subject: [PATCH] build.rs create hooks dir if not exists --- build.rs | 3 +++ src/builtins/uuid.rs | 1 + src/scheduler.rs | 1 + 3 files changed, 5 insertions(+) diff --git a/build.rs b/build.rs index a26f4e9f..42cf34d5 100644 --- a/build.rs +++ b/build.rs @@ -8,6 +8,9 @@ fn main() -> Result<()> { // Copy hooks to appropriate location so that git will run them. // In git worktrees, .git is a symlink and the following commands fail. if Path::new(".git").is_dir() { + if !Path::new("./.git/hooks").exists() { + std::fs::create_dir_all("./.git/hooks")?; + } std::fs::copy("./scripts/pre-commit", "./.git/hooks/pre-commit")?; std::fs::copy("./scripts/pre-push", "./.git/hooks/pre-push")?; } diff --git a/src/builtins/uuid.rs b/src/builtins/uuid.rs index 92c337e3..8fb8aed5 100644 --- a/src/builtins/uuid.rs +++ b/src/builtins/uuid.rs @@ -121,6 +121,7 @@ fn timestamp(uuid: &Uuid) -> Option { // https://github.com/uuid-rs/uuid/blob/94ecea893fadac93248f1bd6f47673c09cec5912/src/lib.rs#L900-L904 if uuid.get_version_num() == 2 { let (ticks, counter) = decode_rfc4122_timestamp(uuid); + #[allow(deprecated)] return Some(Timestamp::from_rfc4122(ticks, counter)); } diff --git a/src/scheduler.rs b/src/scheduler.rs index 3645996a..c19f41f8 100644 --- a/src/scheduler.rs +++ b/src/scheduler.rs @@ -386,6 +386,7 @@ pub struct Analyzer { } #[derive(Debug, Clone)] +#[allow(dead_code)] pub struct Schedule { pub scopes: BTreeMap, Scope>, pub order: BTreeMap, Vec>,