Use pretty json by default

This commit is contained in:
Tony
2024-10-04 09:40:33 +08:00
parent 4037589000
commit 1ef9f6a487
3 changed files with 29 additions and 23 deletions
+1 -11
View File
@@ -37,11 +37,7 @@ pub fn run() {
.plugin(tauri_plugin_os::init())
.plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_shell::init())
.plugin(
tauri_plugin_store::Builder::default()
.register_serialize_fn("pretty-json".to_owned(), pretty_json)
.build(),
)
.plugin(tauri_plugin_store::Builder::default().build())
.setup(move |app| {
#[cfg(desktop)]
{
@@ -163,9 +159,3 @@ pub fn run() {
}
})
}
fn pretty_json(
cache: &std::collections::HashMap<String, serde_json::Value>,
) -> Result<Vec<u8>, Box<dyn std::error::Error + Send + Sync>> {
Ok(serde_json::to_vec_pretty(&cache)?)
}