From 09406d01dad815ad1fe53e132b085645940ac709 Mon Sep 17 00:00:00 2001 From: ehlxr Date: Wed, 23 Feb 2022 23:09:27 +0800 Subject: [PATCH] update at 2022-02-23 23:09:27 by ehlxr --- mylib/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mylib/src/lib.rs b/mylib/src/lib.rs index 08a4ab9..f9a44d3 100644 --- a/mylib/src/lib.rs +++ b/mylib/src/lib.rs @@ -15,13 +15,13 @@ pub extern "system" fn Java_me_ehlxr_HelloWorld_fetchNameStr( { let jstr = env.get_string(JString::from(result)).unwrap(); // println!("call getNameStr result: {}", String::from(jstr)); - format!("Hello, {}! from Rust..", String::from(jstr)) + String::from(jstr) } else { - format!("Hello! from Rust..") + "".to_string() }; let output = env - .new_string(out_str) + .new_string(format!("Hello{}! from Rust..", out_str)) .expect("Couldn't create java string!"); output.into_inner() }