aboutsummaryrefslogtreecommitdiff
path: root/src/ids.rs
diff options
context:
space:
mode:
authorGravatar Jake Swenson <jake@jakeswenson.com> 2021-08-30 08:27:10 -0700
committerGravatar Jake Swenson <jake@jakeswenson.com> 2021-08-30 08:27:10 -0700
commiteab748bf990a304063c476fb7cdeab0ec8c325f7 (patch)
tree2211af13fff6028e346641aacf3fad2a1fe3c512 /src/ids.rs
parenta78a8d9444426a608888755eb1537905b7d1d96a (diff)
downloadnotion-eab748bf990a304063c476fb7cdeab0ec8c325f7.tar.gz
notion-eab748bf990a304063c476fb7cdeab0ec8c325f7.tar.zst
notion-eab748bf990a304063c476fb7cdeab0ec8c325f7.zip
Improve ergonomics
Diffstat (limited to 'src/ids.rs')
-rw-r--r--src/ids.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ids.rs b/src/ids.rs
index 6febe63..2ede5e0 100644
--- a/src/ids.rs
+++ b/src/ids.rs
@@ -19,6 +19,15 @@ where
}
}
+impl<T> AsIdentifier<T> for &T
+where
+ T: Identifier,
+{
+ fn as_id(&self) -> &T {
+ self
+ }
+}
+
macro_rules! identifer {
($name:ident) => {
#[derive(serde::Serialize, serde::Deserialize, Debug, Eq, PartialEq, Hash, Clone)]