File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ use serde_json::json;
1010use std:: sync:: Arc ;
1111use miette:: Result ;
1212
13- use crate :: container:: { self , ContainerState , HACKEROS_RUN , HACKEROS_LOG } ;
13+ use crate :: container:: { ContainerState , HACKEROS_RUN , HACKEROS_LOG } ;
1414use crate :: config:: HkConfig ;
1515use crate :: pod:: { PodSpec , PodState } ;
1616use crate :: metrics:: gather_metrics;
@@ -217,8 +217,8 @@ async fn list_pods(State(_state): State<Arc<AppState>>) -> Response {
217217 let pods = tokio:: task:: spawn_blocking ( || {
218218 let mut pods = Vec :: new ( ) ;
219219 let pods_dir = std:: path:: PathBuf :: from ( crate :: container:: HACKEROS_RUN ) . join ( "pods" ) ;
220- if pods_dir . exists ( ) {
221- for entry in std :: fs :: read_dir ( pods_dir ) . unwrap_or_default ( ) . flatten ( ) {
220+ if let Ok ( entries ) = std :: fs :: read_dir ( pods_dir ) {
221+ for entry in entries . flatten ( ) {
222222 let path = entry. path ( ) ;
223223 if path. extension ( ) . map_or ( false , |e| e == "json" ) {
224224 if let Ok ( content) = std:: fs:: read_to_string ( & path) {
You can’t perform that action at this time.
0 commit comments