From e6709f64af1836460aee41aca34eb19ed3a337dd Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Mon, 4 Nov 2019 03:12:19 +0800 Subject: Rename and fix typos --- crates/ra_tt/src/lib.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'crates/ra_tt/src') 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; /// source token and making sure that identities are preserved during macro /// expansion. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct TokenId(u32, u32); +pub struct TokenId { + token_id: u32, + map_id: u32, +} impl TokenId { pub fn new(token_id: u32, map_id: u32) -> TokenId { - TokenId(token_id, map_id) + TokenId { token_id, map_id } } pub const fn unspecified() -> TokenId { - TokenId(!0, !0) + TokenId { token_id: !0, map_id: !0 } } pub fn token_id(&self) -> u32 { - self.0 + self.token_id } pub fn map_id(&self) -> u32 { - self.1 + self.map_id } } -- cgit v1.2.3