Skip to content

Commit 3c7903e

Browse files
committed
indenting json
1 parent c5e2c7c commit 3c7903e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/sauce/home.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,13 @@ fn convert_string(entry: &Entry) -> String {
192192
async fn download_xs_cache(selected_indexes: HashSet<usize>) {
193193
let cache = generate_cache(&selected_indexes).await;
194194

195-
// Convert the cache data to JSON
196-
let json_data = serde_json::to_string(&cache).unwrap();
195+
// Convert the cache data to a pretty-printed JSON string
196+
let json_data = serde_json::to_string_pretty(&cache).unwrap();
197197

198198
// Create a Blob from the JSON data
199199
let mut blob_options = BlobPropertyBag::new();
200200
blob_options.set_type("application/json");
201-
201+
202202
let blob = Blob::new_with_str_sequence_and_options(
203203
&Array::of1(&JsValue::from_str(&json_data)),
204204
&blob_options,
@@ -216,7 +216,6 @@ async fn download_xs_cache(selected_indexes: HashSet<usize>) {
216216
document.body().unwrap().append_child(&a).unwrap();
217217

218218
// Trigger the download
219-
220219
let a: HtmlElement = a.dyn_into::<HtmlElement>().unwrap();
221220
a.click();
222221

0 commit comments

Comments
 (0)