From 463e5af181420e0de6db0fbe5cd38f63eda2da86 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 20 Sep 2021 10:37:24 +1000 Subject: [PATCH] Ensure `Either` type is referenced correctly Crates can be renamed in `Cargo.toml`. To ensure we reference the `Either` type correctly, we need to use the special-cased `$crate` substitution. See https://veykril.github.io/tlborm/decl-macros/minutiae/import-export.html. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index cccf317..9d8bca2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,8 +58,8 @@ pub enum Either { macro_rules! for_both { ($value:expr, $pattern:pat => $result:expr) => { match $value { - Either::Left($pattern) => $result, - Either::Right($pattern) => $result, + $crate::Either::Left($pattern) => $result, + $crate::Either::Right($pattern) => $result, } }; }