Skip to content

Commit b59f2f5

Browse files
authored
feat(core): expose scope::fs::Scope::new (#8432)
1 parent 11a1529 commit b59f2f5

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.changes/expose-fs-scope-new.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch:feat
3+
---
4+
5+
Expose `scope::fs::Scope::new`.

core/tauri/src/app.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,7 @@ impl<R: Runtime> Builder<R> {
15681568
app.manage(Scopes {
15691569
ipc: scope::ipc::Scope::new(app.config()),
15701570
#[cfg(feature = "protocol-asset")]
1571-
asset_protocol: scope::fs::Scope::for_fs_api(
1571+
asset_protocol: scope::fs::Scope::new(
15721572
&app,
15731573
&app.config().tauri.security.asset_protocol.scope,
15741574
)?,

core/tauri/src/scope/fs.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,10 @@ fn push_pattern<P: AsRef<Path>, F: Fn(&str) -> Result<Pattern, glob::PatternErro
9191
}
9292

9393
impl Scope {
94-
/// Creates a new scope from a `FsAllowlistScope` configuration.
95-
#[allow(unused)]
96-
pub(crate) fn for_fs_api<R: crate::Runtime, M: crate::Manager<R>>(
94+
/// Creates a new scope from a [`FsScope`] configuration.
95+
pub fn new<R: crate::Runtime, M: crate::Manager<R>>(
9796
manager: &M,
98-
scope: &tauri_utils::config::FsScope,
97+
scope: &FsScope,
9998
) -> crate::Result<Self> {
10099
let mut allowed_patterns = HashSet::new();
101100
for path in scope.allowed_paths() {

0 commit comments

Comments
 (0)