We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
enum
Encode
1 parent 0355358 commit e3d2016Copy full SHA for e3d2016
library/proc_macro/src/bridge/rpc.rs
@@ -58,16 +58,11 @@ macro_rules! rpc_encode_decode {
58
fn encode(self, w: &mut Writer, s: &mut S) {
59
// HACK(eddyb): `Tag` enum duplicated between the
60
// two impls as there's no other place to stash it.
61
- #[allow(non_upper_case_globals)]
62
- mod tag {
63
- #[repr(u8)] enum Tag { $($variant),* }
64
-
65
- $(pub(crate) const $variant: u8 = Tag::$variant as u8;)*
66
- }
+ #[repr(u8)] enum Tag { $($variant),* }
67
68
match self {
69
$($name::$variant $(($field))* => {
70
- tag::$variant.encode(w, s);
+ (Tag::$variant as u8).encode(w, s);
71
$($field.encode(w, s);)*
72
})*
73
}
0 commit comments