Add #[must_use] on builders

This commit is contained in:
Joonas Javanainen 2015-08-26 12:16:07 +01:00
parent 9b2d199d3d
commit cca4c17417
5 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,7 @@ use std::ptr;
use super::{Ui, ImStr};
#[must_use]
pub struct Menu<'ui, 'p> {
label: ImStr<'p>,
enabled: bool,
@ -34,6 +35,7 @@ impl<'ui, 'p> Menu<'ui, 'p> {
}
}
#[must_use]
pub struct MenuItem<'ui, 'p> {
label: ImStr<'p>,
shortcut: Option<ImStr<'p>>,

View File

@ -5,6 +5,7 @@ use super::{Ui, ImStr};
// TODO: Consider using Range, even though it is half-open
#[must_use]
pub struct SliderInt<'ui, 'p> {
label: ImStr<'p>,
value: &'p mut i32,
@ -41,6 +42,7 @@ impl<'ui, 'p> SliderInt<'ui, 'p> {
}
}
#[must_use]
pub struct SliderFloat<'ui, 'p> {
label: ImStr<'p>,
value: &'p mut f32,

View File

@ -3,6 +3,7 @@ use std::marker::PhantomData;
use super::{Ui, ImGuiSetCond, ImStr};
#[must_use]
pub struct TreeNode<'ui, 'p> {
id: ImStr<'p>,
label: Option<ImStr<'p>>,

View File

@ -4,6 +4,7 @@ use std::ptr;
use super::{Ui, ImStr};
#[must_use]
pub struct CollapsingHeader<'ui, 'p> {
label: ImStr<'p>,
str_id: Option<ImStr<'p>>,

View File

@ -13,6 +13,7 @@ use super::{
ImStr, ImVec2
};
#[must_use]
pub struct Window<'ui, 'p> {
pos: (f32, f32),
pos_cond: ImGuiSetCond,