mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 07:14:50 +01:00
fix: make version return a static string
moved .to_string() into each glue code
This commit is contained in:
parent
306a687354
commit
6dedb5f0b3
5 changed files with 6 additions and 6 deletions
|
@ -4,7 +4,7 @@ use jni_toolbox::jni;
|
|||
#[allow(non_snake_case)]
|
||||
#[jni(package = "mp.code", class = "Extensions")]
|
||||
fn version() -> String {
|
||||
crate::version()
|
||||
crate::version().to_string()
|
||||
}
|
||||
|
||||
/// Calculate the XXH3 hash for a given String.
|
||||
|
|
|
@ -9,5 +9,5 @@ pub fn js_hash(data: String) -> i64 {
|
|||
/// Get the current version of the client
|
||||
#[napi(js_name = "version")]
|
||||
pub fn js_version() -> String {
|
||||
crate::version()
|
||||
crate::version().to_string()
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ fn entrypoint(lua: &Lua) -> LuaResult<LuaTable> {
|
|||
|
||||
exports.set(
|
||||
"version",
|
||||
lua.create_function(|_, ()| Ok(crate::version()))?,
|
||||
lua.create_function(|_, ()| Ok(crate::version().to_string()))?,
|
||||
)?;
|
||||
|
||||
// runtime
|
||||
|
|
|
@ -134,7 +134,7 @@ impl Driver {
|
|||
|
||||
#[pyfunction]
|
||||
fn version() -> String {
|
||||
crate::version()
|
||||
crate::version().to_string()
|
||||
}
|
||||
|
||||
#[pyfunction]
|
||||
|
|
|
@ -127,6 +127,6 @@ pub mod ffi;
|
|||
pub(crate) mod network;
|
||||
|
||||
/// Get the current version of the client
|
||||
pub fn version() -> String {
|
||||
env!("CARGO_PKG_VERSION").to_owned()
|
||||
pub fn version() -> &'static str {
|
||||
env!("CARGO_PKG_VERSION")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue