Skip to content
Snippets Groups Projects
Commit 53df1b90 authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

refactor(storage): add some sanity checks to this monstrosity

parent f935278c
No related branches found
No related tags found
1 merge request!442feat(node): Node::storage_watcher for notifications on storage changes
......@@ -60,6 +60,8 @@ macro_rules! define_clusterwide_spaces {
}
}
$( const _: $crate::util::CheckIsSameType<$_cw_struct, $cw_struct> = (); )+
$(#[$cw_index_meta])*
#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Hash)]
pub enum $cw_index {
......
......@@ -420,6 +420,20 @@ where
}
}
////////////////////////////////////////////////////////////////////////////////
/// IsSameType
pub trait IsSameType<L, R> {
type Void;
}
impl<T> IsSameType<T, T> for T {
type Void = ();
}
#[allow(unused)]
pub type CheckIsSameType<L, R> = <L as IsSameType<L, R>>::Void;
////////////////////////////////////////////////////////////////////////////////
/// tests
#[cfg(test)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment