diff --git a/.changes/expose-fs-scope-new.md b/.changes/expose-fs-scope-new.md new file mode 100644 index 000000000..08b41aaa4 --- /dev/null +++ b/.changes/expose-fs-scope-new.md @@ -0,0 +1,5 @@ +--- +"tauri": patch:feat +--- + +Expose `scope::fs::Scope::new`. diff --git a/core/tauri/src/app.rs b/core/tauri/src/app.rs index 337c8843a..f33b6af94 100644 --- a/core/tauri/src/app.rs +++ b/core/tauri/src/app.rs @@ -1568,7 +1568,7 @@ impl Builder { app.manage(Scopes { ipc: scope::ipc::Scope::new(app.config()), #[cfg(feature = "protocol-asset")] - asset_protocol: scope::fs::Scope::for_fs_api( + asset_protocol: scope::fs::Scope::new( &app, &app.config().tauri.security.asset_protocol.scope, )?, diff --git a/core/tauri/src/scope/fs.rs b/core/tauri/src/scope/fs.rs index c68b2d8ff..b842299bf 100644 --- a/core/tauri/src/scope/fs.rs +++ b/core/tauri/src/scope/fs.rs @@ -91,11 +91,10 @@ fn push_pattern, F: Fn(&str) -> Result>( + /// Creates a new scope from a [`FsScope`] configuration. + pub fn new>( manager: &M, - scope: &tauri_utils::config::FsScope, + scope: &FsScope, ) -> crate::Result { let mut allowed_patterns = HashSet::new(); for path in scope.allowed_paths() {