Skip to content

Commit

Permalink
nicknames_json_exists()関数のデシリアライズチェックを最適化
Browse files Browse the repository at this point in the history
- デシリアライズ結果の確認方法を`_`パターンから`is_ok()`メソッドに変更
- コードの可読性と意図をより明確に
- デシリアライズ処理のチェックロジックを簡潔に改善
  • Loading branch information
eda3 committed Mar 3, 2025
1 parent 759c78d commit a07a637
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub async fn nicknames_json_exists(init_check: bool) -> Option<String> {
};

// JSON デシリアライズ試行
if let Ok(_) = serde_json::from_str::<Vec<Nicknames>>(&data_from_file) {
if serde_json::from_str::<Vec<Nicknames>>(&data_from_file).is_ok() {
println!("{}", "Successfully read 'nicknames.json' file.".green());
None
} else {
Expand Down

0 comments on commit a07a637

Please sign in to comment.