diff options
author | Edwin Cheng <[email protected]> | 2019-11-03 19:12:19 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-11-04 17:38:20 +0000 |
commit | e6709f64af1836460aee41aca34eb19ed3a337dd (patch) | |
tree | 62b98c0237cf8816502cdf9cfaf9645c318e9919 /crates/ra_tt | |
parent | d8b7ba201e005e533d132f4942ad611468f21a28 (diff) |
Rename and fix typos
Diffstat (limited to 'crates/ra_tt')
-rw-r--r-- | crates/ra_tt/src/lib.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crates/ra_tt/src/lib.rs b/crates/ra_tt/src/lib.rs index 96410ff22..1449618f3 100644 --- a/crates/ra_tt/src/lib.rs +++ b/crates/ra_tt/src/lib.rs | |||
@@ -25,23 +25,26 @@ use smol_str::SmolStr; | |||
25 | /// source token and making sure that identities are preserved during macro | 25 | /// source token and making sure that identities are preserved during macro |
26 | /// expansion. | 26 | /// expansion. |
27 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 27 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
28 | pub struct TokenId(u32, u32); | 28 | pub struct TokenId { |
29 | token_id: u32, | ||
30 | map_id: u32, | ||
31 | } | ||
29 | 32 | ||
30 | impl TokenId { | 33 | impl TokenId { |
31 | pub fn new(token_id: u32, map_id: u32) -> TokenId { | 34 | pub fn new(token_id: u32, map_id: u32) -> TokenId { |
32 | TokenId(token_id, map_id) | 35 | TokenId { token_id, map_id } |
33 | } | 36 | } |
34 | 37 | ||
35 | pub const fn unspecified() -> TokenId { | 38 | pub const fn unspecified() -> TokenId { |
36 | TokenId(!0, !0) | 39 | TokenId { token_id: !0, map_id: !0 } |
37 | } | 40 | } |
38 | 41 | ||
39 | pub fn token_id(&self) -> u32 { | 42 | pub fn token_id(&self) -> u32 { |
40 | self.0 | 43 | self.token_id |
41 | } | 44 | } |
42 | 45 | ||
43 | pub fn map_id(&self) -> u32 { | 46 | pub fn map_id(&self) -> u32 { |
44 | self.1 | 47 | self.map_id |
45 | } | 48 | } |
46 | } | 49 | } |
47 | 50 | ||