Open lo48576 opened 3 years ago
That's a good question, thanks! Originally the concrete types for Default
were made with the idea that "Spur
is the default type, so that's what Default
should make", but I think I just forgot to update the definition of Default
when I messed with new()
. It still does have the downside that it no longer allows Rodeo::default()
to "just work" due to inference, but that probably doesn't matter very much
I tried this code
I expected this to happen
The code compiles.
Instead this happened
This does not compile. Compiler says
error[E0277]: the trait bound `lasso::Rodeo<lasso::MiniSpur>: std::default::Default` is not satisfied
.Meta
Lasso version: 0.5.0
Rustc version: 1.52.0
Additional context
impl Default for Rodeo<Spur, RandomState>
redirects toSelf::new()
, andSelf::new()
is implemented for anyRodeo<K, RandomState> where K: Key
. Is there any reason not to implementimpl<K: Key> Default for Rodeo<K, RandomState>
?