Engine::load_package API change.
This commit is contained in:
parent
a2858e0fd3
commit
096eb4493e
@ -33,6 +33,7 @@ Breaking changes
|
||||
* Function signature for defining custom syntax is simplified.
|
||||
* `Engine::register_raw_fn_XXX` API shortcuts are removed.
|
||||
* `PackagesCollection::get_fn`, `PackagesCollection::contains_fn`, `Module::get_fn` and `Module::contains_fn` now take an additional `public_only` parameter indicating whether only public functions are accepted.
|
||||
* `Engine::load_package` takes any type that is `Into<PackageLibrary>`.
|
||||
|
||||
Housekeeping
|
||||
------------
|
||||
|
@ -18,9 +18,9 @@ impl Engine {
|
||||
///
|
||||
/// When searching for functions, packages loaded later are preferred.
|
||||
/// In other words, loaded packages are searched in reverse order.
|
||||
pub fn load_package(&mut self, package: PackageLibrary) -> &mut Self {
|
||||
pub fn load_package(&mut self, package: impl Into<PackageLibrary>) -> &mut Self {
|
||||
// Push the package to the top - packages are searched in reverse order
|
||||
self.packages.push(package);
|
||||
self.packages.push(package.into());
|
||||
self
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ fn test_fn_ptr_curry_call() -> Result<(), Box<EvalAltResult>> {
|
||||
);
|
||||
|
||||
let mut engine = Engine::new();
|
||||
engine.load_package(module.into());
|
||||
engine.load_package(module);
|
||||
|
||||
#[cfg(not(feature = "no_object"))]
|
||||
assert_eq!(
|
||||
|
Loading…
Reference in New Issue
Block a user