mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-14 13:26:21 +02:00
Ensure examples compile on latest version of AOSP (#2414)
This is part of #2398.
This commit is contained in:
parent
c16c07a53a
commit
7a462efb57
@ -22,12 +22,12 @@ use jni::JNIEnv;
|
|||||||
/// HelloWorld::hello method implementation.
|
/// HelloWorld::hello method implementation.
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "system" fn Java_HelloWorld_hello(
|
pub extern "system" fn Java_HelloWorld_hello(
|
||||||
env: JNIEnv,
|
mut env: JNIEnv,
|
||||||
_class: JClass,
|
_class: JClass,
|
||||||
name: JString,
|
name: JString,
|
||||||
) -> jstring {
|
) -> jstring {
|
||||||
let input: String = env.get_string(name).unwrap().into();
|
let input: String = env.get_string(&name).unwrap().into();
|
||||||
let greeting = format!("Hello, {input}!");
|
let greeting = format!("Hello, {input}!");
|
||||||
let output = env.new_string(greeting).unwrap();
|
let output = env.new_string(greeting).unwrap();
|
||||||
output.into_inner()
|
output.into_raw()
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ fn main() {
|
|||||||
logger::init(
|
logger::init(
|
||||||
logger::Config::default()
|
logger::Config::default()
|
||||||
.with_tag_on_device("rust")
|
.with_tag_on_device("rust")
|
||||||
.with_min_level(log::Level::Trace),
|
.with_max_level(log::LevelFilter::Trace),
|
||||||
);
|
);
|
||||||
debug!("Starting program.");
|
debug!("Starting program.");
|
||||||
info!("Things are going fine.");
|
info!("Things are going fine.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user