diff --git a/version.rs b/version.rs index 312fe8a..e043354 100644 --- a/version.rs +++ b/version.rs @@ -16,6 +16,7 @@ struct Entry { namespace: String, version: String, } +type Cache = reflector::Store; fn deployment_to_entry(d: &Deployment) -> Option { let name = d.name_any(); @@ -32,7 +33,7 @@ fn deployment_to_entry(d: &Deployment) -> Option { } #[instrument(skip(store))] -async fn get_versions(State(store): State>) -> Json> { +async fn get_versions(State(store): State) -> Json> { let data = store.state().iter().filter_map(|d| deployment_to_entry(d)).collect(); Json(data) } @@ -45,10 +46,7 @@ struct EntryPath { } #[instrument(skip(store))] -async fn get_version( - State(store): State>, - path: EntryPath, -) -> impl IntoResponse { +async fn get_version(State(store): State, path: EntryPath) -> impl IntoResponse { let key = reflector::ObjectRef::new(&path.name).within(&path.namespace); if let Some(Some(e)) = store.get(&key).map(|d| deployment_to_entry(&d)) { return Ok(Json(e));