Skip to content

Commit f285b17

Browse files
committed
controllers::helpers: Use json! macro to simplify JSON serialization code
1 parent da37e26 commit f285b17

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/controllers/helpers.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ pub(crate) mod pagination;
55
pub(crate) use self::pagination::Paginate;
66

77
pub fn ok_true() -> EndpointResult {
8-
#[derive(Serialize)]
9-
struct R {
10-
ok: bool,
11-
}
12-
13-
Ok(json_response(&R { ok: true }))
8+
let json = json!({ "ok": true });
9+
Ok(json_response(&json))
1410
}

0 commit comments

Comments
 (0)