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.
This commit is contained in:
Malik Olivier Boussejra 2018-04-08 09:08:02 +09:00
parent 664660a090
commit eab85ea871
2 changed files with 2 additions and 4 deletions

View File

@ -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| {

View File

@ -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| {