Remove DefaultKey trait

We no longer use `.get` function directly, so DefaultKey does not make
much sense
This commit is contained in:
Aleksey Kladov 2018-10-07 14:01:58 +03:00
parent e5c97040f1
commit 6c09f40733

View file

@ -174,14 +174,6 @@ where
})
}
/// Equivalent to `of(DefaultKey::default_key())`
pub fn read(&self) -> Q::Value
where
Q::Key: DefaultKey,
{
self.get(DefaultKey::default_key())
}
/// Assign a value to an "input queries". Must be used outside of
/// an active query computation.
pub fn set(&self, key: Q::Key, value: Q::Value)
@ -218,20 +210,6 @@ where
}
}
/// A variant of the `Default` trait used for query keys that are
/// either singletons (e.g., `()`) or have some overwhelming default.
/// In this case, you can write `query.my_query().read()` as a
/// convenient shorthand.
pub trait DefaultKey {
fn default_key() -> Self;
}
impl DefaultKey for () {
fn default_key() -> Self {
()
}
}
/// A macro that helps in defining the "context trait" of a given
/// module. This is a trait that defines everything that a block of
/// queries need to execute, as well as defining the queries