From 58a42aad73a1007599099289a8623537180f65d3 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Tue, 17 Sep 2024 00:08:41 +0900 Subject: [PATCH] Minor refactor --- crates/voicevox_core_python_api/src/lib.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/voicevox_core_python_api/src/lib.rs b/crates/voicevox_core_python_api/src/lib.rs index e04f3bb63..c1635f755 100644 --- a/crates/voicevox_core_python_api/src/lib.rs +++ b/crates/voicevox_core_python_api/src/lib.rs @@ -155,9 +155,9 @@ impl Drop for Closable { } #[derive(Clone)] -struct VoiceModelFileImmutableFields { - id: PyObject, - metas: Py, +struct VoiceModelFilePyFields { + id: PyObject, // `NewType("VoiceModelId", UUID)` + metas: Py, // `list[SpeakerMeta]` } #[pyfunction] @@ -185,13 +185,13 @@ mod blocking { UserDictWord, }; - use crate::{convert::VoicevoxCoreResultExt as _, Closable, VoiceModelFileImmutableFields}; + use crate::{convert::VoicevoxCoreResultExt as _, Closable, VoiceModelFilePyFields}; #[pyclass] #[derive(Clone)] pub(crate) struct VoiceModelFile { model: Arc, Self>>>, - immut_fields: VoiceModelFileImmutableFields, + immut_fields: VoiceModelFilePyFields, } #[pymethods] @@ -207,7 +207,7 @@ mod blocking { Ok(Self { model, - immut_fields: VoiceModelFileImmutableFields { id, metas }, + immut_fields: VoiceModelFilePyFields { id, metas }, }) } @@ -725,14 +725,14 @@ mod asyncio { UserDictWord, }; - use crate::{convert::VoicevoxCoreResultExt as _, Closable, VoiceModelFileImmutableFields}; + use crate::{convert::VoicevoxCoreResultExt as _, Closable, VoiceModelFilePyFields}; #[pyclass] #[derive(Clone)] pub(crate) struct VoiceModelFile { model: Arc, Self>>>, - immut_fields: VoiceModelFileImmutableFields, + immut_fields: VoiceModelFilePyFields, } #[pymethods] @@ -753,7 +753,7 @@ mod asyncio { Ok(Self { model, - immut_fields: VoiceModelFileImmutableFields { id, metas }, + immut_fields: VoiceModelFilePyFields { id, metas }, }) }) }