diff --git a/Cargo.lock b/Cargo.lock index 0ce5e84df..e33dbc954 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -768,12 +768,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "core-foundation" version = "0.9.4" @@ -1039,13 +1033,32 @@ version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "convert_case", "proc-macro2", "quote", - "rustc_version", "syn 1.0.102", ] +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", + "unicode-xid", +] + [[package]] name = "deunicode" version = "1.6.0" @@ -3417,7 +3430,7 @@ checksum = "4eb30575f3638fc8f6815f448d50cb1a2e255b0897985c8c59f4d37b72a07b06" dependencies = [ "bitflags 2.5.0", "cssparser", - "derive_more", + "derive_more 0.99.17", "fxhash", "log", "new_debug_unreachable", @@ -4463,7 +4476,7 @@ dependencies = [ "const_format", "derive-getters", "derive-new", - "derive_more", + "derive_more 1.0.0", "duplicate", "easy-ext", "educe", @@ -4554,7 +4567,7 @@ version = "0.0.0" dependencies = [ "android_logger", "chrono", - "derive_more", + "derive_more 1.0.0", "duplicate", "easy-ext", "jni", diff --git a/Cargo.toml b/Cargo.toml index 4c3567d36..d4b62869b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ const_format = "0.2.33" derive-getters = "0.2.0" derive-new = "0.5.9" derive-syn-parse = "0.2.0" -derive_more = "0.99.17" +derive_more = "1.0.0" duct = "0.13.7" duplicate = "2.0.0" easy-ext = "1.0.2" diff --git a/crates/voicevox_core/Cargo.toml b/crates/voicevox_core/Cargo.toml index 8052b312a..82ada11be 100644 --- a/crates/voicevox_core/Cargo.toml +++ b/crates/voicevox_core/Cargo.toml @@ -25,7 +25,7 @@ camino.workspace = true const_format.workspace = true derive-getters.workspace = true derive-new.workspace = true -derive_more.workspace = true +derive_more = { workspace = true, features = ["add", "deref", "display", "from", "from_str"] } duplicate.workspace = true easy-ext.workspace = true educe.workspace = true diff --git a/crates/voicevox_core/src/devices.rs b/crates/voicevox_core/src/devices.rs index fa7710c80..ea46db6cf 100644 --- a/crates/voicevox_core/src/devices.rs +++ b/crates/voicevox_core/src/devices.rs @@ -180,19 +180,19 @@ enum DeviceAvailability { #[derive(Clone, Copy, PartialEq, Debug, derive_more::Display)] pub(crate) enum DeviceSpec { - #[display(fmt = "CPU")] + #[display("CPU")] Cpu, - #[display(fmt = "{_0}")] + #[display("{_0}")] Gpu(GpuSpec), } #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, derive_more::Display)] pub(crate) enum GpuSpec { - #[display(fmt = "CUDA (device_id=0)")] + #[display("CUDA (device_id=0)")] Cuda, - #[display(fmt = "DirectML (device_id=0)")] + #[display("DirectML (device_id=0)")] Dml, } diff --git a/crates/voicevox_core/src/engine/full_context_label.rs b/crates/voicevox_core/src/engine/full_context_label.rs index dab5cbae5..50472f3e1 100644 --- a/crates/voicevox_core/src/engine/full_context_label.rs +++ b/crates/voicevox_core/src/engine/full_context_label.rs @@ -18,13 +18,13 @@ pub(crate) struct FullContextLabelError { #[derive(derive_more::Display, Debug)] enum ErrorKind { - #[display(fmt = "Open JTalkで解釈することができませんでした")] + #[display("Open JTalkで解釈することができませんでした")] OpenJtalk, - #[display(fmt = "jlabelでラベルを解釈することができませんでした")] + #[display("jlabelでラベルを解釈することができませんでした")] Jlabel, - #[display(fmt = "too long mora")] + #[display("too long mora")] TooLongMora, } diff --git a/crates/voicevox_core/src/error.rs b/crates/voicevox_core/src/error.rs index 33775bda0..55c83097f 100644 --- a/crates/voicevox_core/src/error.rs +++ b/crates/voicevox_core/src/error.rs @@ -180,16 +180,16 @@ pub(crate) struct LoadModelError { #[derive(derive_more::Display, Debug)] pub(crate) enum LoadModelErrorKind { - #[display(fmt = "ZIPファイルとして開くことができませんでした")] + #[display("ZIPファイルとして開くことができませんでした")] OpenZipFile, - #[display(fmt = "`{filename}`を読み取れませんでした")] + #[display("`{filename}`を読み取れませんでした")] ReadZipEntry { filename: String }, - #[display(fmt = "モデルの形式が不正です")] + #[display("モデルの形式が不正です")] InvalidModelFormat, - #[display(fmt = "モデル`{id}`は既に読み込まれています")] + #[display("モデル`{id}`は既に読み込まれています")] ModelAlreadyLoaded { id: VoiceModelId }, - #[display(fmt = "スタイル`{id}`は既に読み込まれています")] + #[display("スタイル`{id}`は既に読み込まれています")] StyleAlreadyLoaded { id: StyleId }, - #[display(fmt = "モデルデータを読むことができませんでした")] + #[display("モデルデータを読むことができませんでした")] InvalidModelData, } diff --git a/crates/voicevox_core/src/infer.rs b/crates/voicevox_core/src/infer.rs index 7b81b7c5d..589c51777 100644 --- a/crates/voicevox_core/src/infer.rs +++ b/crates/voicevox_core/src/infer.rs @@ -162,10 +162,10 @@ impl InputScalar for T { #[derive(Clone, Copy, PartialEq, derive_more::Display)] pub(crate) enum InputScalarKind { - #[display(fmt = "int64_t")] + #[display("int64_t")] Int64, - #[display(fmt = "float")] + #[display("float")] Float32, } @@ -209,7 +209,7 @@ impl OutputScalar for f32 { #[derive(Clone, Copy, PartialEq, derive_more::Display)] pub(crate) enum OutputScalarKind { - #[display(fmt = "float")] + #[display("float")] Float32, } diff --git a/crates/voicevox_core_java_api/Cargo.toml b/crates/voicevox_core_java_api/Cargo.toml index 96d2c1ce7..b165fc5d5 100644 --- a/crates/voicevox_core_java_api/Cargo.toml +++ b/crates/voicevox_core_java_api/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] [dependencies] android_logger.workspace = true chrono = { workspace = true, default-features = false, features = ["clock"] } -derive_more.workspace = true +derive_more = { workspace = true, features = ["from"] } duplicate.workspace = true easy-ext.workspace = true jni.workspace = true