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.
This commit is contained in:
Thomas Eizinger
2021-09-20 10:37:24 +10:00
parent c80df60e05
commit 463e5af181
+2 -2
View File
@@ -58,8 +58,8 @@ pub enum Either<L, R> {
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,
}
};
}