summaryrefslogtreecommitdiff
path: root/rust/src/lib.rs
diff options
context:
space:
mode:
authorRubens Brandao <git@rubens.io>2024-04-17 12:35:04 -0300
committerKyle Martin <krm504@nyu.edu>2024-05-09 14:00:01 -0400
commitc528f3ad0e1abd4168b1507e8c30bc14c4a6a736 (patch)
tree83d13b9b64be9383929e755efa97fd4877b5f2ec /rust/src/lib.rs
parent71a1c7e162046a44e7640e468b69a2b59599b198 (diff)
fix rust doc code
Diffstat (limited to 'rust/src/lib.rs')
-rw-r--r--rust/src/lib.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/rust/src/lib.rs b/rust/src/lib.rs
index 739bfbf6..8a51a7d8 100644
--- a/rust/src/lib.rs
+++ b/rust/src/lib.rs
@@ -49,7 +49,7 @@
//!
//! Create a new library (`cargo new --lib <plugin-name>`) and include the following in your `Cargo.toml`:
//!
-//! ```
+//! ```toml
//! [lib]
//! crate-type = ["cdylib"]
//!
@@ -73,17 +73,19 @@
//!
//! ### `main.rs`
//! Standalone binaries need to initialize Binary Ninja before they can work. You can do this through [`headless::Session`], [`headless::script_helper`], or [`headless::init()`] at start and [`headless::shutdown()`] at shutdown.
-//! ```rust
+//! ```no_run
//! // This loads all the core architecture, platform, etc plugins
//! // Standalone executables need to call this, but plugins do not
//! let headless_session = binaryninja::headless::Session::new();
//!
//! println!("Loading binary...");
//! let bv = headless_session.load("/bin/cat").expect("Couldn't open `/bin/cat`");
+//!
+//! // Your code here...
//! ```
//!
//! ### `Cargo.toml`
-//! ```
+//! ```toml
//! [dependencies]
//! binaryninja = { git = "https://github.com/Vector35/binaryninja-api.git", branch = "dev"}
//! ```
@@ -215,7 +217,7 @@ pub fn load<S: BnStrCompatible>(filename: S) -> Option<rc::Ref<binaryview::Binar
/// The main way to open and load files (with options) into Binary Ninja. Make sure you've properly initialized the core before calling this function. See [`crate::headless::init()`]
///
-/// ```rust
+/// ```no_run
/// let settings = [("analysis.linearSweep.autorun", false)].into();
///
/// let bv = binaryninja::load_with_options("/bin/cat", true, Some(settings))