From 2845ba6208ce3c29998a48df5073ed15a11ead77 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Mon, 14 Feb 2022 18:41:40 -0500 Subject: Rust: Minor tweaks to 2890; merge architecture::InstructionTextToken and disassembly::InstructionTextToken; update examples --- rust/examples/basic_script/src/main.rs | 2 +- rust/examples/decompile/src/main.rs | 2 +- rust/examples/template/src/main.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'rust/examples') diff --git a/rust/examples/basic_script/src/main.rs b/rust/examples/basic_script/src/main.rs index 94e89df4..9aaf29fc 100644 --- a/rust/examples/basic_script/src/main.rs +++ b/rust/examples/basic_script/src/main.rs @@ -27,7 +27,7 @@ fn main() { Some((_, tokens)) => { tokens .iter() - .for_each(|token| print!("{}", token.text().to_str().unwrap())); + .for_each(|token| print!("{}", token.text().as_str())); println!("") } _ => (), diff --git a/rust/examples/decompile/src/main.rs b/rust/examples/decompile/src/main.rs index accb7697..ee8cab1b 100644 --- a/rust/examples/decompile/src/main.rs +++ b/rust/examples/decompile/src/main.rs @@ -14,7 +14,7 @@ struct Args { } fn decompile_to_c(view: &BinaryView, func: &Function) { - let mut settings = DisassemblySettings::new(); + let settings = DisassemblySettings::new(); settings.set_option(DisassemblyOption::ShowAddress, false); settings.set_option(DisassemblyOption::WaitForIL, true); diff --git a/rust/examples/template/src/main.rs b/rust/examples/template/src/main.rs index 7947c0f7..9125aeaa 100644 --- a/rust/examples/template/src/main.rs +++ b/rust/examples/template/src/main.rs @@ -32,7 +32,7 @@ fn main() { Some((_, tokens)) => { tokens .iter() - .for_each(|token| print!("{}", token.text().to_str().unwrap())); + .for_each(|token| print!("{}", token.text().as_str())); println!("") } _ => (), -- cgit v1.3.1