From c528f3ad0e1abd4168b1507e8c30bc14c4a6a736 Mon Sep 17 00:00:00 2001 From: Rubens Brandao Date: Wed, 17 Apr 2024 12:35:04 -0300 Subject: fix rust doc code --- rust/src/headless.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'rust/src/headless.rs') diff --git a/rust/src/headless.rs b/rust/src/headless.rs index e4024d8e..740c3dc6 100644 --- a/rust/src/headless.rs +++ b/rust/src/headless.rs @@ -101,12 +101,13 @@ pub fn shutdown() { } /// Prelued-postlued helper function (calls [`init`] and [`shutdown`] for you) -/// ```rust +/// ```no_run +/// # use binaryninja::binaryview::BinaryViewExt; /// binaryninja::headless::script_helper(|| { -/// binaryninja::load("/bin/cat") -/// .expect("Couldn't open `/bin/cat`") -/// .iter() -/// .for_each(|func| println!(" `{}`", func.symbol().full_name())); +/// let cat = binaryninja::load("/bin/cat").expect("Couldn't open `/bin/cat`"); +/// for function in cat.functions().iter() { +/// println!(" `{}`", function.symbol().full_name()); +/// } /// }); /// ``` pub fn script_helper(func: fn()) { @@ -124,7 +125,7 @@ impl Session { Self {} } - /// ```rust + /// ```no_run /// let headless_session = binaryninja::headless::Session::new(); /// /// let bv = headless_session.load("/bin/cat").expect("Couldn't open `/bin/cat`"); @@ -133,7 +134,7 @@ impl Session { crate::load(filename) } - /// ```rust + /// ```no_run /// let settings = [("analysis.linearSweep.autorun", false)].into(); /// let headless_session = binaryninja::headless::Session::new(); /// -- cgit v1.3.1