Do not build index for multiple packages to avoid Engine creation regression.

This commit is contained in:
Stephen Chung
2020-05-08 13:27:51 +08:00
parent e6fabe58cc
commit e0745ef069
4 changed files with 52 additions and 45 deletions

View File

@@ -44,12 +44,6 @@ macro_rules! def_package {
pub struct $package($root::packages::PackageLibrary);
impl $root::packages::Package for $package {
fn new() -> Self {
let mut pkg = $root::packages::PackageStore::new();
Self::init(&mut pkg);
Self(pkg.into())
}
fn get(&self) -> $root::packages::PackageLibrary {
self.0.clone()
}
@@ -58,6 +52,14 @@ macro_rules! def_package {
$block
}
}
impl $package {
pub fn new() -> Self {
let mut pkg = $root::packages::PackageStore::new();
<Self as $root::packages::Package>::init(&mut pkg);
Self(pkg.into())
}
}
};
}