From 8dcd3abf936688b7099a6e117ea924ee3a25b2f3 Mon Sep 17 00:00:00 2001 From: CRT Date: Sun, 27 Sep 2026 20:18:45 +0000 Subject: [PATCH] host: read_json takes the runtime as impl Runtime so callers can name only T read_json::(app, name) did not compile with two explicit generic parameters; the app's call sites name only the value type. --- crates/waybetter-host/src/host.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/waybetter-host/src/host.rs b/crates/waybetter-host/src/host.rs index 5070723..7e85a1d 100644 --- a/crates/waybetter-host/src/host.rs +++ b/crates/waybetter-host/src/host.rs @@ -59,7 +59,8 @@ pub fn data_file(app: &AppHandle, name: &str) -> Option(app: &AppHandle, name: &str) -> Option { +/// `read_json::(app, name)`: the app-data JSON file `name`, or None when missing or invalid. +pub fn read_json(app: &AppHandle, name: &str) -> Option { serde_json::from_str(&std::fs::read_to_string(data_file(app, name)?).ok()?).ok() }