Skip to content

Commit

Permalink
フレームデータ更新関数の引数を参照渡しに変更
Browse files Browse the repository at this point in the history
- `get_char_data()`関数の引数を`&[&str; CHARS.len()]`に変更
- `update.rs`の呼び出し箇所を参照渡しに修正
- 関数の型安全性と一貫性を向上
  • Loading branch information
eda3 committed Mar 3, 2025
1 parent f5b74a3 commit 73df82a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/commands/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub async fn update(ctx: Context<'_>) -> Result<()> {
ctx.say("Update started!").await?; // 更新開始通知

// 全キャラクター情報更新
framedata::get_char_data(CHARS, "all").await; // フレームデータ更新
framedata::get_char_data(&CHARS, "all").await; // フレームデータ更新
images::get_char_images(&CHARS, "all").await; // 画像データ更新

ctx.say("Update succesful!").await?; // 更新完了通知
Expand Down Expand Up @@ -66,7 +66,7 @@ pub async fn character(

// 更新対象分岐処理
ctx.say("Update started!").await?; // 更新開始通知
framedata::get_char_data(CHARS, &character_arg_altered).await; // フレームデータ更新
framedata::get_char_data(&CHARS, &character_arg_altered).await; // フレームデータ更新
images::get_char_images(&CHARS, &character_arg_altered).await; // 画像データ更新

ctx.say("Update succesful!").await?; // 更新完了通知
Expand Down
2 changes: 1 addition & 1 deletion src/commands/update/framedata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const SITE_HALF: &str =
/// ```rust,no_run
/// get_char_data(CHARS, "Sol_Badguy").await;
/// ```
pub async fn get_char_data(chars_ids: [&str; CHARS.len()], specific_char: &str) {
pub async fn get_char_data(chars_ids: &[&str; CHARS.len()], specific_char: &str) {
// 更新時間計測開始
let now = Instant::now();

Expand Down

0 comments on commit 73df82a

Please sign in to comment.