From 9faea2364dee4fbc9391ad233c570b70256ef002 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 13 Mar 2020 16:05:46 +0100 Subject: Use `dyn Trait` for working with databse It improves compile time in `--release` mode quite a bit, it doesn't really slow things down and, conceptually, it seems closer to what we want the physical architecture to look like (we don't want to monomorphise EVERYTHING in a single leaf crate). --- crates/ra_db/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/ra_db/src/lib.rs') diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index d500d5e85..bac24e218 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs @@ -32,6 +32,10 @@ macro_rules! impl_intern_key { }; } +pub trait Upcast { + fn upcast(&self) -> &T; +} + pub trait CheckCanceled { /// Aborts current query if there are pending changes. /// -- cgit v1.2.3