We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
json!
1 parent 0424d29 commit 103f23cCopy full SHA for 103f23c
src/controllers/user/me.rs
@@ -83,21 +83,12 @@ pub fn updates(req: &mut dyn RequestExt) -> EndpointResult {
83
.map(|(version, crate_name, published_by, actions)| {
84
EncodableVersion::from(version, &crate_name, published_by, actions)
85
})
86
- .collect();
+ .collect::<Vec<_>>();
87
88
- #[derive(Serialize)]
89
- struct R {
90
- versions: Vec<EncodableVersion>,
91
- meta: Meta,
92
- }
93
94
- struct Meta {
95
- more: bool,
96
97
- Ok(req.json(&R {
98
- versions,
99
- meta: Meta { more },
100
- }))
+ Ok(req.json(&json!({
+ "versions": versions,
+ "meta": { "more": more },
+ })))
101
}
102
103
/// Handles the `PUT /users/:user_id` route.
0 commit comments