mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-30 17:48:50 +02:00
fix(fs): match default value of create option with js documentation (#865)
* fix(fs): inconsistency in guest-js & rust side * Update .changes/fix-fs-write-default-option.md
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"fs": "patch"
|
||||||
|
"fs-js": "patch"
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix incorrect `create` option default value for `writeFile` and `writeTextFile` which didn't match documentation.
|
||||||
@@ -585,7 +585,7 @@ pub struct WriteFileOptions {
|
|||||||
base: BaseOptions,
|
base: BaseOptions,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
append: bool,
|
append: bool,
|
||||||
#[serde(default)]
|
#[serde(default = "default_create_value")]
|
||||||
create: bool,
|
create: bool,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
create_new: bool,
|
create_new: bool,
|
||||||
@@ -593,6 +593,10 @@ pub struct WriteFileOptions {
|
|||||||
mode: Option<u32>,
|
mode: Option<u32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn default_create_value() -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
fn write_file_inner<R: Runtime>(
|
fn write_file_inner<R: Runtime>(
|
||||||
app: AppHandle<R>,
|
app: AppHandle<R>,
|
||||||
path: SafePathBuf,
|
path: SafePathBuf,
|
||||||
|
|||||||
Reference in New Issue
Block a user