From 777c592b64fb5eccce6956ba7b59dab48d1e9717 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Tue, 16 Apr 2024 02:19:37 +0900 Subject: [PATCH] =?UTF-8?q?`cstr!("=E2=80=A6")`=E3=82=92`c"=E2=80=A6"`?= =?UTF-8?q?=E3=81=AB=E7=BD=AE=E3=81=8D=E6=8F=9B=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 63 +++++++---------- Cargo.toml | 7 +- crates/voicevox_core_c_api/Cargo.toml | 1 - crates/voicevox_core_c_api/src/drop_check.rs | 4 +- crates/voicevox_core_c_api/src/result_code.rs | 68 ++++++++----------- .../tests/e2e/testcases/simple_tts.rs | 3 +- .../testcases/synthesizer_new_output_json.rs | 3 +- .../e2e/testcases/tts_via_audio_query.rs | 3 +- .../tests/e2e/testcases/user_dict_load.rs | 11 ++- .../e2e/testcases/user_dict_manipulate.rs | 10 ++- 10 files changed, 71 insertions(+), 102 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6222c0f39..e8532f0dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -935,16 +935,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "cstr" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aa998c33a6d3271e3678950a22134cd7dd27cef86dee1b611b5b14207d1d90b" -dependencies = [ - "proc-macro2", - "quote", -] - [[package]] name = "ctor" version = "0.1.23" @@ -1060,7 +1050,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -1071,7 +1061,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -1258,7 +1248,7 @@ checksum = "48c69b3965971f5d0ea6a6dd26b55cdd517ae0e1425dc8d94e482a5915bd7ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -1271,7 +1261,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -1504,7 +1494,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -2588,7 +2578,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -2664,7 +2654,7 @@ dependencies = [ "regex", "regex-syntax 0.7.5", "structmeta", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -2865,9 +2855,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e" dependencies = [ "unicode-ident", ] @@ -2952,7 +2942,7 @@ dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -2965,7 +2955,7 @@ dependencies = [ "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -3233,7 +3223,7 @@ dependencies = [ "quote", "rand 0.8.5", "rustc_version 0.4.0", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -3415,7 +3405,7 @@ checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -3497,7 +3487,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -3740,7 +3730,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -3751,7 +3741,7 @@ checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -3818,9 +3808,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" dependencies = [ "proc-macro2", "quote", @@ -3914,7 +3904,7 @@ checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -4032,7 +4022,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] @@ -4206,9 +4196,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "typetag" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eecd98403ae5ea2813689125cf5b3f99c40b8abed46c0a8945c81eadb673b31" +checksum = "edc3ebbaab23e6cc369cb48246769d031f5bd85f1b28141f32982e3c0c7b33cf" dependencies = [ "erased-serde", "inventory", @@ -4219,13 +4209,13 @@ dependencies = [ [[package]] name = "typetag-impl" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f9568611f0de5e83e0993b85c54679cd0afd659adcfcb0233f16280b980492e" +checksum = "bb01b60fcc3f5e17babb1a9956263f3ccd2cadc3e52908400231441683283c1d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.102", + "syn 2.0.59", ] [[package]] @@ -4417,7 +4407,6 @@ dependencies = [ "chrono", "clap 4.0.10", "colorchoice", - "cstr", "derive-getters", "duct", "easy-ext", @@ -4470,7 +4459,7 @@ dependencies = [ "indexmap 2.0.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.59", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 21b9a0ac9..3b113bf36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,6 @@ chrono = { version = "0.4.26", default-features = false } clap = "4.0.10" color-eyre = "0.6.2" colorchoice = "1.0.0" -cstr = "0.2.11" # https://github.com/dtolnay/syn/issues/1502 derive-getters = "0.2.0" derive-new = "0.5.9" derive_more = "0.99.17" @@ -54,7 +53,7 @@ once_cell = "1.18.0" ouroboros = "0.18.0" parse-display = "0.8.2" pretty_assertions = "1.3.0" -proc-macro2 = "1.0.69" +proc-macro2 = "1.0.80" pyo3 = "0.20.3" pyo3-asyncio = "0.20.0" pyo3-log = "0.9.0" @@ -70,7 +69,7 @@ serde_with = "3.3.0" smallvec = "1.13.1" strum = "0.24.1" surf = "2.3.2" -syn = "2.0.38" +syn = "2.0.59" tar = "0.4.38" tempfile = "3.6.0" test_util = { path = "crates/test_util" } @@ -79,7 +78,7 @@ tokio = "1.25.0" toml = "0.7.2" tracing = "0.1.37" tracing-subscriber = "0.3.16" -typetag = "0.2.5" +typetag = "0.2.7" url = "2.3.0" uuid = "1.4.0" voicevox_core = { path = "crates/voicevox_core" } diff --git a/crates/voicevox_core_c_api/Cargo.toml b/crates/voicevox_core_c_api/Cargo.toml index 3d950f0e8..0a23844b9 100644 --- a/crates/voicevox_core_c_api/Cargo.toml +++ b/crates/voicevox_core_c_api/Cargo.toml @@ -21,7 +21,6 @@ anstyle-query.workspace = true camino.workspace = true chrono = { workspace = true, default-features = false, features = ["clock"] } colorchoice.workspace = true -cstr.workspace = true derive-getters.workspace = true futures.workspace = true itertools.workspace = true diff --git a/crates/voicevox_core_c_api/src/drop_check.rs b/crates/voicevox_core_c_api/src/drop_check.rs index 36acec570..ae02d6aa2 100644 --- a/crates/voicevox_core_c_api/src/drop_check.rs +++ b/crates/voicevox_core_c_api/src/drop_check.rs @@ -107,8 +107,6 @@ impl CStringDropChecker { mod tests { use std::ffi::{c_char, CStr}; - use cstr::cstr; - use super::CStringDropChecker; #[test] @@ -118,7 +116,7 @@ mod tests { )] fn it_denies_duplicated_char_ptr() { let checker = CStringDropChecker::new(); - let s = cstr!("").to_owned(); + let s = c"".to_owned(); checker.whitelist(checker.whitelist(s)); } diff --git a/crates/voicevox_core_c_api/src/result_code.rs b/crates/voicevox_core_c_api/src/result_code.rs index 65236ada4..9a15e7924 100644 --- a/crates/voicevox_core_c_api/src/result_code.rs +++ b/crates/voicevox_core_c_api/src/result_code.rs @@ -1,7 +1,5 @@ use std::ffi::CStr; -use cstr::cstr; - /// 処理結果を示す結果コード。 #[repr(i32)] #[derive(Debug, PartialEq, Eq, Clone, Copy)] @@ -60,52 +58,44 @@ pub enum VoicevoxResultCode { pub(crate) const fn error_result_to_message(result_code: VoicevoxResultCode) -> &'static CStr { use VoicevoxResultCode::*; match result_code { - VOICEVOX_RESULT_NOT_LOADED_OPENJTALK_DICT_ERROR => { - cstr!("OpenJTalkの辞書が読み込まれていません") - } - VOICEVOX_RESULT_GPU_SUPPORT_ERROR => cstr!("GPU機能をサポートすることができません"), + VOICEVOX_RESULT_NOT_LOADED_OPENJTALK_DICT_ERROR => c"OpenJTalkの辞書が読み込まれていません", + VOICEVOX_RESULT_GPU_SUPPORT_ERROR => c"GPU機能をサポートすることができません", VOICEVOX_RESULT_GET_SUPPORTED_DEVICES_ERROR => { - cstr!("サポートされているデバイス情報取得中にエラーが発生しました") + c"サポートされているデバイス情報取得中にエラーが発生しました" } - VOICEVOX_RESULT_OK => cstr!("エラーが発生しませんでした"), - VOICEVOX_RESULT_STYLE_NOT_FOUND_ERROR => cstr!( - "指定されたIDに対するスタイルが見つかりませんでした。音声モデルが読み込まれていないか\ - 、読み込みが解除されています" - ), - VOICEVOX_RESULT_MODEL_NOT_FOUND_ERROR => cstr!( - "指定されたIDに対する音声モデルが見つかりませんでした。読み込まれていないか、読み込み\ - が既に解除されています" - ), - VOICEVOX_RESULT_INFERENCE_ERROR => cstr!("推論に失敗しました"), - VOICEVOX_RESULT_EXTRACT_FULL_CONTEXT_LABEL_ERROR => { - cstr!("入力テキストからのフルコンテキストラベル抽出に失敗しました") + VOICEVOX_RESULT_OK => c"エラーが発生しませんでした", + VOICEVOX_RESULT_STYLE_NOT_FOUND_ERROR => { + c"指定されたIDに対するスタイルが見つかりませんでした。音声モデルが読み込まれていないか\ + 、読み込みが解除されています" } - VOICEVOX_RESULT_INVALID_UTF8_INPUT_ERROR => cstr!("入力テキストが無効なUTF-8データでした"), - VOICEVOX_RESULT_PARSE_KANA_ERROR => { - cstr!("入力テキストをAquesTalk風記法としてパースすることに失敗しました") + VOICEVOX_RESULT_MODEL_NOT_FOUND_ERROR => { + c"指定されたIDに対する音声モデルが見つかりませんでした。読み込まれていないか、読み込み\ + が既に解除されています" } - VOICEVOX_RESULT_INVALID_AUDIO_QUERY_ERROR => cstr!("無効なaudio_queryです"), - VOICEVOX_RESULT_INVALID_ACCENT_PHRASE_ERROR => cstr!("無効なaccent_phraseです"), - VOICEVOX_RESULT_OPEN_ZIP_FILE_ERROR => cstr!("ZIPファイルのオープンに失敗しました"), - VOICEVOX_RESULT_READ_ZIP_ENTRY_ERROR => { - cstr!("ZIP内のファイルを読むことができませんでした") - } - VOICEVOX_RESULT_MODEL_ALREADY_LOADED_ERROR => cstr!("同じIDのモデルを読むことはできません"), - VOICEVOX_RESULT_STYLE_ALREADY_LOADED_ERROR => { - cstr!("同じIDのスタイルを読むことはできません") + VOICEVOX_RESULT_INFERENCE_ERROR => c"推論に失敗しました", + VOICEVOX_RESULT_EXTRACT_FULL_CONTEXT_LABEL_ERROR => { + c"入力テキストからのフルコンテキストラベル抽出に失敗しました" } - VOICEVOX_RESULT_INVALID_MODEL_DATA_ERROR => { - cstr!("モデルデータを読むことができませんでした") + VOICEVOX_RESULT_INVALID_UTF8_INPUT_ERROR => c"入力テキストが無効なUTF-8データでした", + VOICEVOX_RESULT_PARSE_KANA_ERROR => { + c"入力テキストをAquesTalk風記法としてパースすることに失敗しました" } - VOICEVOX_RESULT_LOAD_USER_DICT_ERROR => cstr!("ユーザー辞書を読み込めませんでした"), - VOICEVOX_RESULT_SAVE_USER_DICT_ERROR => cstr!("ユーザー辞書を書き込めませんでした"), + VOICEVOX_RESULT_INVALID_AUDIO_QUERY_ERROR => c"無効なaudio_queryです", + VOICEVOX_RESULT_INVALID_ACCENT_PHRASE_ERROR => c"無効なaccent_phraseです", + VOICEVOX_RESULT_OPEN_ZIP_FILE_ERROR => c"ZIPファイルのオープンに失敗しました", + VOICEVOX_RESULT_READ_ZIP_ENTRY_ERROR => c"ZIP内のファイルを読むことができませんでした", + VOICEVOX_RESULT_MODEL_ALREADY_LOADED_ERROR => c"同じIDのモデルを読むことはできません", + VOICEVOX_RESULT_STYLE_ALREADY_LOADED_ERROR => c"同じIDのスタイルを読むことはできません", + VOICEVOX_RESULT_INVALID_MODEL_DATA_ERROR => c"モデルデータを読むことができませんでした", + VOICEVOX_RESULT_LOAD_USER_DICT_ERROR => c"ユーザー辞書を読み込めませんでした", + VOICEVOX_RESULT_SAVE_USER_DICT_ERROR => c"ユーザー辞書を書き込めませんでした", VOICEVOX_RESULT_USER_DICT_WORD_NOT_FOUND_ERROR => { - cstr!("ユーザー辞書に単語が見つかりませんでした") + c"ユーザー辞書に単語が見つかりませんでした" } - VOICEVOX_RESULT_USE_USER_DICT_ERROR => cstr!("OpenJTalkのユーザー辞書の設定に失敗しました"), + VOICEVOX_RESULT_USE_USER_DICT_ERROR => c"OpenJTalkのユーザー辞書の設定に失敗しました", VOICEVOX_RESULT_INVALID_USER_DICT_WORD_ERROR => { - cstr!("ユーザー辞書の単語のバリデーションに失敗しました") + c"ユーザー辞書の単語のバリデーションに失敗しました" } - VOICEVOX_RESULT_INVALID_UUID_ERROR => cstr!("UUIDの変換に失敗しました"), + VOICEVOX_RESULT_INVALID_UUID_ERROR => c"UUIDの変換に失敗しました", } } diff --git a/crates/voicevox_core_c_api/tests/e2e/testcases/simple_tts.rs b/crates/voicevox_core_c_api/tests/e2e/testcases/simple_tts.rs index 9631249fa..5590e1b45 100644 --- a/crates/voicevox_core_c_api/tests/e2e/testcases/simple_tts.rs +++ b/crates/voicevox_core_c_api/tests/e2e/testcases/simple_tts.rs @@ -1,7 +1,6 @@ use std::{collections::HashMap, ffi::CString, mem::MaybeUninit}; use assert_cmd::assert::AssertResult; -use cstr::cstr; use libloading::Library; use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; @@ -43,7 +42,7 @@ impl assert_cdylib::TestCase for TestCase { let model = { let mut model = MaybeUninit::uninit(); assert_ok(voicevox_voice_model_new_from_path( - cstr!("../../model/sample.vvm").as_ptr(), + c"../../model/sample.vvm".as_ptr(), model.as_mut_ptr(), )); model.assume_init() diff --git a/crates/voicevox_core_c_api/tests/e2e/testcases/synthesizer_new_output_json.rs b/crates/voicevox_core_c_api/tests/e2e/testcases/synthesizer_new_output_json.rs index a836a409c..138ea72f5 100644 --- a/crates/voicevox_core_c_api/tests/e2e/testcases/synthesizer_new_output_json.rs +++ b/crates/voicevox_core_c_api/tests/e2e/testcases/synthesizer_new_output_json.rs @@ -4,7 +4,6 @@ use std::{ }; use assert_cmd::assert::AssertResult; -use cstr::cstr; use libloading::Library; use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; @@ -64,7 +63,7 @@ impl assert_cdylib::TestCase for TestCase { let model = { let mut model = MaybeUninit::uninit(); assert_ok(voicevox_voice_model_new_from_path( - cstr!("../../model/sample.vvm").as_ptr(), + c"../../model/sample.vvm".as_ptr(), model.as_mut_ptr(), )); model.assume_init() diff --git a/crates/voicevox_core_c_api/tests/e2e/testcases/tts_via_audio_query.rs b/crates/voicevox_core_c_api/tests/e2e/testcases/tts_via_audio_query.rs index 6cfe7994e..d185d7626 100644 --- a/crates/voicevox_core_c_api/tests/e2e/testcases/tts_via_audio_query.rs +++ b/crates/voicevox_core_c_api/tests/e2e/testcases/tts_via_audio_query.rs @@ -1,7 +1,6 @@ use std::{collections::HashMap, ffi::CString, mem::MaybeUninit}; use assert_cmd::assert::AssertResult; -use cstr::cstr; use libloading::Library; use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; @@ -45,7 +44,7 @@ impl assert_cdylib::TestCase for TestCase { let model = { let mut model = MaybeUninit::uninit(); assert_ok(voicevox_voice_model_new_from_path( - cstr!("../../model/sample.vvm").as_ptr(), + c"../../model/sample.vvm".as_ptr(), model.as_mut_ptr(), )); model.assume_init() diff --git a/crates/voicevox_core_c_api/tests/e2e/testcases/user_dict_load.rs b/crates/voicevox_core_c_api/tests/e2e/testcases/user_dict_load.rs index 7c2e13afe..d1b4c8113 100644 --- a/crates/voicevox_core_c_api/tests/e2e/testcases/user_dict_load.rs +++ b/crates/voicevox_core_c_api/tests/e2e/testcases/user_dict_load.rs @@ -8,7 +8,6 @@ use std::ffi::{CStr, CString}; use std::mem::MaybeUninit; use test_util::OPEN_JTALK_DIC_DIR; -use cstr::cstr; use libloading::Library; use serde::{Deserialize, Serialize}; @@ -50,8 +49,8 @@ impl assert_cdylib::TestCase for TestCase { let word = { let mut word = voicevox_user_dict_word_make( - cstr!("this_word_should_not_exist_in_default_dictionary").as_ptr(), - cstr!("アイウエオ").as_ptr(), + c"this_word_should_not_exist_in_default_dictionary".as_ptr(), + c"アイウエオ".as_ptr(), ); word.word_type = VoicevoxUserDictWordType::VOICEVOX_USER_DICT_WORD_TYPE_PROPER_NOUN; word.priority = 10; @@ -64,7 +63,7 @@ impl assert_cdylib::TestCase for TestCase { let model = { let mut model = MaybeUninit::uninit(); assert_ok(voicevox_voice_model_new_from_path( - cstr!("../../model/sample.vvm").as_ptr(), + c"../../model/sample.vvm".as_ptr(), model.as_mut_ptr(), )); model.assume_init() @@ -98,7 +97,7 @@ impl assert_cdylib::TestCase for TestCase { let mut audio_query_without_dict = std::ptr::null_mut(); assert_ok(voicevox_synthesizer_create_audio_query( synthesizer, - cstr!("this_word_should_not_exist_in_default_dictionary").as_ptr(), + c"this_word_should_not_exist_in_default_dictionary".as_ptr(), STYLE_ID, &mut audio_query_without_dict, )); @@ -111,7 +110,7 @@ impl assert_cdylib::TestCase for TestCase { let mut audio_query_with_dict = std::ptr::null_mut(); assert_ok(voicevox_synthesizer_create_audio_query( synthesizer, - cstr!("this_word_should_not_exist_in_default_dictionary").as_ptr(), + c"this_word_should_not_exist_in_default_dictionary".as_ptr(), STYLE_ID, &mut audio_query_with_dict, )); diff --git a/crates/voicevox_core_c_api/tests/e2e/testcases/user_dict_manipulate.rs b/crates/voicevox_core_c_api/tests/e2e/testcases/user_dict_manipulate.rs index 15b80686f..4a16d7180 100644 --- a/crates/voicevox_core_c_api/tests/e2e/testcases/user_dict_manipulate.rs +++ b/crates/voicevox_core_c_api/tests/e2e/testcases/user_dict_manipulate.rs @@ -9,7 +9,6 @@ use std::{ use tempfile::NamedTempFile; use uuid::Uuid; -use cstr::cstr; use libloading::Library; use serde::{Deserialize, Serialize}; @@ -77,7 +76,7 @@ impl assert_cdylib::TestCase for TestCase { let dict = voicevox_user_dict_new(); // 単語の追加のテスト - let word = voicevox_user_dict_word_make(cstr!("hoge").as_ptr(), cstr!("ホゲ").as_ptr()); + let word = voicevox_user_dict_word_make(c"hoge".as_ptr(), c"ホゲ".as_ptr()); let word_uuid = add_word(dict, &word); @@ -88,7 +87,7 @@ impl assert_cdylib::TestCase for TestCase { assert_contains_uuid(&json, &word_uuid); // 単語の変更のテスト - let word = voicevox_user_dict_word_make(cstr!("fuga").as_ptr(), cstr!("フガ").as_ptr()); + let word = voicevox_user_dict_word_make(c"fuga".as_ptr(), c"フガ".as_ptr()); assert_ok(voicevox_user_dict_update_word( dict, @@ -107,8 +106,7 @@ impl assert_cdylib::TestCase for TestCase { // 辞書のインポートのテスト。 let other_dict = voicevox_user_dict_new(); - let other_word = - voicevox_user_dict_word_make(cstr!("piyo").as_ptr(), cstr!("ピヨ").as_ptr()); + let other_word = voicevox_user_dict_word_make(c"piyo".as_ptr(), c"ピヨ".as_ptr()); let other_word_uuid = add_word(other_dict, &other_word); @@ -136,7 +134,7 @@ impl assert_cdylib::TestCase for TestCase { // 辞書のセーブ・ロードのテスト let temp_path = NamedTempFile::new().unwrap().into_temp_path(); let temp_path = CString::new(temp_path.to_str().unwrap()).unwrap(); - let word = voicevox_user_dict_word_make(cstr!("hoge").as_ptr(), cstr!("ホゲ").as_ptr()); + let word = voicevox_user_dict_word_make(c"hoge".as_ptr(), c"ホゲ".as_ptr()); let word_uuid = add_word(dict, &word); assert_ok(voicevox_user_dict_save(dict, temp_path.as_ptr()));