mirror of
https://github.com/openharmony/third_party_rust_either.git
synced 2026-07-18 21:24:39 -04:00
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:
+2
-2
@@ -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,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user