aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-24 11:13:51 +0000
committerAleksey Kladov <[email protected]>2019-11-24 11:13:51 +0000
commit53506a755220557a558be4da244b70d79f5b0fa9 (patch)
tree0781995393812f583200929cea61c706290ee137 /crates/ra_db
parentf11237561c391eecba39c5ba57defa2dc7a27b21 (diff)
Pull macro up
Diffstat (limited to 'crates/ra_db')
-rw-r--r--crates/ra_db/src/lib.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs
index f9d012cb0..e8852531b 100644
--- a/crates/ra_db/src/lib.rs
+++ b/crates/ra_db/src/lib.rs
@@ -15,6 +15,20 @@ pub use crate::{
15pub use relative_path::{RelativePath, RelativePathBuf}; 15pub use relative_path::{RelativePath, RelativePathBuf};
16pub use salsa; 16pub use salsa;
17 17
18#[macro_export]
19macro_rules! impl_intern_key {
20 ($name:ident) => {
21 impl $crate::salsa::InternKey for $name {
22 fn from_intern_id(v: $crate::salsa::InternId) -> Self {
23 $name(v)
24 }
25 fn as_intern_id(&self) -> $crate::salsa::InternId {
26 self.0
27 }
28 }
29 };
30}
31
18pub trait CheckCanceled { 32pub trait CheckCanceled {
19 /// Aborts current query if there are pending changes. 33 /// Aborts current query if there are pending changes.
20 /// 34 ///