From eab85ea8719ea2129ab97716aa0745bcd8cc229b Mon Sep 17 00:00:00 2001 From: Malik Olivier Boussejra Date: Sun, 8 Apr 2018 09:08:02 +0900 Subject: [PATCH] with_window_draw_list: Fix example test The test was failing because no `main` function was defined, as explained in the rustdoc documentation [1]. Add the "no_run" flag. This way, there is no attempt to run the test code. Only compile checks are done. Thus defining a `main` function is unnecessary. Moreover "export crate imgui" is implicit, so removed. [1] https://doc.rust-lang.org/stable/rustdoc/documentation-tests.html#pre-processing-examples. --- src/lib.rs | 3 +-- src/window_draw_list.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 2f7ada1..753d9db 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1270,8 +1270,7 @@ impl<'ui> Ui<'ui> { /// /// # Examples /// - /// ``` - /// # extern crate imgui; + /// ```rust,no_run /// # use imgui::*; /// fn custom_draw(ui: &Ui) { /// ui.with_window_draw_list(|draw_list| { diff --git a/src/window_draw_list.rs b/src/window_draw_list.rs index cd9e470..2257fae 100644 --- a/src/window_draw_list.rs +++ b/src/window_draw_list.rs @@ -78,8 +78,7 @@ impl<'ui> WindowDrawList<'ui> { /// /// # Example /// - /// ``` - /// # extern crate imgui; + /// ```rust,no_run /// # use imgui::*; /// fn custom_drawing(ui: &Ui) { /// ui.with_window_draw_list(|draw_list| {