-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[project-vvm-async-api] いくつかのC関数を定数にする (#503)
* `voicevox_get_version()` → `voicevox_version` * indocを外す * コメントを更新 * テスト`global_info`を追加 * `make_default_`系を定数に * Minor refactor * diffを減らすためにquoteをダウングレード * Minor refactor * Minor refactor * `SupportedDevices`の中身も確認する * Minor refactor * `version!()` → `VERSION` * `Default`のimplはマクロ側に寄せる * `voicevox_create_supported_devices_json`のシグネチャを直す
- Loading branch information
Showing
19 changed files
with
282 additions
and
176 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
pub const fn get_version() -> &'static str { | ||
env!("CARGO_PKG_VERSION") | ||
} | ||
/// 本クレートの`package.version`。 | ||
/// | ||
/// C APIやPython API側からこの値が使われるべきではない。 | ||
/// 現在はまだRust APIを外部提供していないため、この定数はどこからも参照されていないはずである。 | ||
pub const VERSION: &str = env!("CARGO_PKG_VERSION"); | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
use crate::*; | ||
#[rstest] | ||
fn get_version_works() { | ||
assert_eq!("0.0.0", get_version()); | ||
assert_eq!("0.0.0", VERSION); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.