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.
1 parent bbc2dd4 commit 18141faCopy full SHA for 18141fa
frameworks/Rust/rama/src/main_sqlx.rs
@@ -110,10 +110,12 @@ async fn cache(
110
) -> impl IntoResponse {
111
let count = parse_params(params);
112
let mut rng = SmallRng::from_rng(&mut rng());
113
- let mut worlds: Vec<Option<World>> = Vec::with_capacity(count);
+ let mut worlds: Vec<World> = Vec::with_capacity(count);
114
115
for id in random_ids(&mut rng, count) {
116
- worlds.push(ctx.state().cache.get(&id));
+ if let Some(world) = ctx.state().cache.get(&id) {
117
+ worlds.push(world);
118
+ }
119
}
120
121
(StatusCode::OK, Json(worlds))
0 commit comments