From 59eaad1fdf140912c6f0a59a2b722d28dc756dfa Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Wed, 6 May 2020 22:26:52 +0800 Subject: [PATCH] Create module from file. --- src/module.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/module.rs b/src/module.rs index bdb545b1..1fa704c8 100644 --- a/src/module.rs +++ b/src/module.rs @@ -740,6 +740,15 @@ mod file { pub fn new() -> Self { Default::default() } + + /// Create a `Module` from a file path. + pub fn create_module>( + &self, + engine: &Engine, + path: &str, + ) -> Result> { + self.resolve(engine, path, Default::default()) + } } impl ModuleResolver for FileModuleResolver {