summaryrefslogtreecommitdiffstats
path: root/src/routes/players.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/players.rs')
-rw-r--r--src/routes/players.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/routes/players.rs b/src/routes/players.rs
index 5c90efb..7cfb722 100644
--- a/src/routes/players.rs
+++ b/src/routes/players.rs
@@ -75,14 +75,13 @@ async fn manage_players(
75} 75}
76 76
77fn read_json_list(path: &std::path::Path) -> Vec<String> { 77fn read_json_list(path: &std::path::Path) -> Vec<String> {
78 if let Ok(contents) = std::fs::read_to_string(path) { 78 if let Ok(contents) = std::fs::read_to_string(path)
79 if let Ok(entries) = serde_json::from_str::<Vec<serde_json::Value>>(&contents) { 79 && let Ok(entries) = serde_json::from_str::<Vec<serde_json::Value>>(&contents) {
80 return entries 80 return entries
81 .iter() 81 .iter()
82 .filter_map(|e| e["name"].as_str().map(String::from)) 82 .filter_map(|e| e["name"].as_str().map(String::from))
83 .collect(); 83 .collect();
84 } 84 }
85 }
86 vec![] 85 vec![]
87} 86}
88 87