added deny(rust_2018_idioms)

we might as well be on 2018 if we're going to have to upgrade to 2021 in a few weeks!
This commit is contained in:
Jack Mac 2021-09-15 11:59:00 -04:00
parent 0a06c97526
commit 50edf02d39
20 changed files with 62 additions and 66 deletions

View File

@ -53,7 +53,7 @@ impl ClipboardBackend for DummyClipboardContext {
}
impl fmt::Debug for ClipboardContext {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("ClipboardContext")
// beautiful code, no?
.field("backend", &(&(*self.backend) as *const _))

View File

@ -502,7 +502,7 @@ impl Context {
/// # Panics
///
/// Panics if the context uses a shared font atlas that is already borrowed
pub fn fonts(&mut self) -> FontAtlasRefMut {
pub fn fonts(&mut self) -> FontAtlasRefMut<'_> {
match self.shared_font_atlas {
Some(ref font_atlas) => FontAtlasRefMut::Shared(font_atlas.borrow_mut()),
None => unsafe {
@ -518,7 +518,7 @@ impl Context {
///
/// Panics if the context uses a shared font atlas that is already borrowed
#[doc(alias = "NewFame")]
pub fn frame(&mut self) -> Ui {
pub fn frame(&mut self) -> Ui<'_> {
// Clear default font if it no longer exists. This could be an error in the future
let default_font = self.io().font_default;
if !default_font.is_null() && self.fonts().get_font(FontId(default_font)).is_none() {

View File

@ -174,7 +174,7 @@ impl<'ui> DrawListMut<'ui> {
/// }
/// ```
#[doc(alias = "ChannelsSplit")]
pub fn channels_split<F: FnOnce(&ChannelsSplit)>(&self, channels_count: u32, f: F) {
pub fn channels_split<F: FnOnce(&ChannelsSplit<'_>)>(&self, channels_count: u32, f: F) {
unsafe { sys::ImDrawList_ChannelsSplit(self.draw_list, channels_count as i32) };
f(&ChannelsSplit {
draw_list: self,
@ -373,7 +373,7 @@ impl<'ui> DrawListMut<'ui> {
/// .build();
/// }
/// ```
pub fn add_image(&'ui self, texture_id: TextureId, p_min: [f32; 2], p_max: [f32; 2]) -> Image {
pub fn add_image(&'ui self, texture_id: TextureId, p_min: [f32; 2], p_max: [f32; 2]) -> Image<'_> {
Image::new(self, texture_id, p_min, p_max)
}
@ -387,7 +387,7 @@ impl<'ui> DrawListMut<'ui> {
p2: [f32; 2],
p3: [f32; 2],
p4: [f32; 2],
) -> ImageQuad {
) -> ImageQuad<'_> {
ImageQuad::new(self, texture_id, p1, p2, p3, p4)
}
@ -398,7 +398,7 @@ impl<'ui> DrawListMut<'ui> {
p_min: [f32; 2],
p_max: [f32; 2],
rounding: f32,
) -> ImageRounded {
) -> ImageRounded<'_> {
ImageRounded::new(self, texture_id, p_min, p_max, rounding)
}
}
@ -414,7 +414,7 @@ pub struct Line<'ui> {
}
impl<'ui> Line<'ui> {
fn new<C>(draw_list: &'ui DrawListMut, p1: [f32; 2], p2: [f32; 2], c: C) -> Self
fn new<C>(draw_list: &'ui DrawListMut<'_>, p1: [f32; 2], p2: [f32; 2], c: C) -> Self
where
C: Into<ImColor32>,
{
@ -461,7 +461,7 @@ pub struct Rect<'ui> {
}
impl<'ui> Rect<'ui> {
fn new<C>(draw_list: &'ui DrawListMut, p1: [f32; 2], p2: [f32; 2], c: C) -> Self
fn new<C>(draw_list: &'ui DrawListMut<'_>, p1: [f32; 2], p2: [f32; 2], c: C) -> Self
where
C: Into<ImColor32>,
{
@ -562,7 +562,7 @@ pub struct Triangle<'ui> {
}
impl<'ui> Triangle<'ui> {
fn new<C>(draw_list: &'ui DrawListMut, p1: [f32; 2], p2: [f32; 2], p3: [f32; 2], c: C) -> Self
fn new<C>(draw_list: &'ui DrawListMut<'_>, p1: [f32; 2], p2: [f32; 2], p3: [f32; 2], c: C) -> Self
where
C: Into<ImColor32>,
{
@ -630,7 +630,7 @@ pub struct Circle<'ui> {
impl<'ui> Circle<'ui> {
/// Typically constructed by [`DrawListMut::add_circle`]
pub fn new<C>(draw_list: &'ui DrawListMut, center: [f32; 2], radius: f32, color: C) -> Self
pub fn new<C>(draw_list: &'ui DrawListMut<'_>, center: [f32; 2], radius: f32, color: C) -> Self
where
C: Into<ImColor32>,
{
@ -708,7 +708,7 @@ pub struct BezierCurve<'ui> {
impl<'ui> BezierCurve<'ui> {
/// Typically constructed by [`DrawListMut::add_bezier_curve`]
pub fn new<C>(
draw_list: &'ui DrawListMut,
draw_list: &'ui DrawListMut<'_>,
pos0: [f32; 2],
cp0: [f32; 2],
cp1: [f32; 2],
@ -776,7 +776,7 @@ pub struct Image<'ui> {
impl<'ui> Image<'ui> {
/// Typically constructed by [`DrawListMut::add_image`]
pub fn new(
draw_list: &'ui DrawListMut,
draw_list: &'ui DrawListMut<'_>,
texture_id: TextureId,
p_min: [f32; 2],
p_max: [f32; 2],
@ -849,7 +849,7 @@ pub struct ImageQuad<'ui> {
impl<'ui> ImageQuad<'ui> {
/// Typically constructed by [`DrawListMut::add_image_quad`]
pub fn new(
draw_list: &'ui DrawListMut,
draw_list: &'ui DrawListMut<'_>,
texture_id: TextureId,
p1: [f32; 2],
p2: [f32; 2],
@ -936,7 +936,7 @@ pub struct ImageRounded<'ui> {
impl<'ui> ImageRounded<'ui> {
/// Typically constructed by [`DrawListMut::add_image_rounded`]
pub fn new(
draw_list: &'ui DrawListMut,
draw_list: &'ui DrawListMut<'_>,
texture_id: TextureId,
p_min: [f32; 2],
p_max: [f32; 2],

View File

@ -70,7 +70,7 @@ unsafe impl RawCast<sys::ImFontAtlas> for FontAtlas {}
impl FontAtlas {
#[doc(alias = "AddFontDefault", alias = "AddFont")]
pub fn add_font(&mut self, font_sources: &[FontSource]) -> FontId {
pub fn add_font(&mut self, font_sources: &[FontSource<'_>]) -> FontId {
let (head, tail) = font_sources.split_first().unwrap();
let font_id = self.add_font_internal(head, false);
for font in tail {
@ -78,7 +78,7 @@ impl FontAtlas {
}
font_id
}
fn add_font_internal(&mut self, font_source: &FontSource, merge_mode: bool) -> FontId {
fn add_font_internal(&mut self, font_source: &FontSource<'_>, merge_mode: bool) -> FontId {
let mut raw_config = sys_font_config_default();
raw_config.MergeMode = merge_mode;
let raw_font = match font_source {
@ -141,7 +141,7 @@ impl FontAtlas {
}
/// Builds a 1 byte per-pixel font atlas texture
#[doc(alias = "GetTextDataAsAlpha8")]
pub fn build_alpha8_texture(&mut self) -> FontAtlasTexture {
pub fn build_alpha8_texture(&mut self) -> FontAtlasTexture<'_> {
let mut pixels: *mut c_uchar = ptr::null_mut();
let mut width: c_int = 0;
let mut height: c_int = 0;
@ -175,7 +175,7 @@ impl FontAtlas {
}
/// Builds a 4 byte per-pixel font atlas texture
#[doc(alias = "GetTextDataAsRGBA32")]
pub fn build_rgba32_texture(&mut self) -> FontAtlasTexture {
pub fn build_rgba32_texture(&mut self) -> FontAtlasTexture<'_> {
let mut pixels: *mut c_uchar = ptr::null_mut();
let mut width: c_int = 0;
let mut height: c_int = 0;

View File

@ -859,7 +859,7 @@ extern "C" fn callback<T: InputTextCallbackHandler>(
let callback_data = unsafe {
CallbackData {
event_flag: InputTextFlags::from_bits((*data).EventFlag as u32).unwrap(),
user_data: &mut *((*data).UserData as *mut UserData<T>),
user_data: &mut *((*data).UserData as *mut UserData<'_, T>),
}
};

View File

@ -101,7 +101,7 @@ impl<'ui> Ui<'ui> {
///
/// Returns a `GroupToken` that must be ended by calling `.end()`
#[doc(alias = "BeginGroup")]
pub fn begin_group(&self) -> GroupToken {
pub fn begin_group(&self) -> GroupToken<'_> {
unsafe { sys::igBeginGroup() };
GroupToken::new(self)
}

View File

@ -1,4 +1,5 @@
#![cfg_attr(test, allow(clippy::float_cmp))]
#![deny(rust_2018_idioms)]
pub extern crate imgui_sys as sys;
use std::cell;
@ -95,18 +96,12 @@ pub fn dear_imgui_version() -> &'static str {
}
}
#[test]
fn test_version() {
// TODO: what's the point of this test?
assert!(dear_imgui_version().starts_with("1."));
}
impl Context {
/// Returns the global imgui-rs time.
///
/// Incremented by Io::delta_time every frame.
#[doc(alias = "GetTime")]
pub fn time(&self, input: f64) -> f64 {
pub fn time(&self) -> f64 {
unsafe { sys::igGetTime() }
}
/// Returns the global imgui-rs frame count.
@ -171,8 +166,9 @@ impl<'ui> Ui<'ui> {
pub fn io(&self) -> &Io {
unsafe { &*(sys::igGetIO() as *const Io) }
}
/// Returns an immutable reference to the font atlas
pub fn fonts(&self) -> FontAtlasRef {
pub fn fonts(&self) -> FontAtlasRef<'_> {
match self.font_atlas {
Some(ref font_atlas) => FontAtlasRef::Shared(font_atlas),
None => unsafe {

View File

@ -37,7 +37,7 @@ unsafe impl RawCast<sys::ImDrawData> for DrawData {}
impl DrawData {
/// Returns an iterator over the draw lists included in the draw data.
#[inline]
pub fn draw_lists(&self) -> DrawListIterator {
pub fn draw_lists(&self) -> DrawListIterator<'_> {
unsafe {
DrawListIterator {
iter: self.cmd_lists().iter(),
@ -181,7 +181,7 @@ impl DrawList {
}
#[inline]
pub fn commands(&self) -> DrawCmdIterator {
pub fn commands(&self) -> DrawCmdIterator<'_> {
unsafe {
DrawCmdIterator {
iter: self.cmd_buffer().iter(),

View File

@ -59,7 +59,7 @@ impl<'ui> Ui<'ui> {
/// color.pop();
/// ```
#[doc(alias = "PushStyleColorVec4")]
pub fn push_style_color(&self, style_color: StyleColor, color: [f32; 4]) -> ColorStackToken {
pub fn push_style_color(&self, style_color: StyleColor, color: [f32; 4]) -> ColorStackToken<'_> {
unsafe { sys::igPushStyleColor_Vec4(style_color as i32, color.into()) };
ColorStackToken::new(self)
}
@ -115,7 +115,7 @@ impl<'ui> Ui<'ui> {
/// style.pop();
/// ```
#[doc(alias = "PushStyleVar")]
pub fn push_style_var(&self, style_var: StyleVar) -> StyleStackToken {
pub fn push_style_var(&self, style_var: StyleVar) -> StyleStackToken<'_> {
unsafe { push_style_var(style_var) };
StyleStackToken::new(self)
}
@ -196,7 +196,7 @@ pub struct MultiColorStackToken {
impl MultiColorStackToken {
/// Pops changes from the color stack
#[doc(alias = "PopStyleColor")]
pub fn pop(mut self, _: &Ui) {
pub fn pop(mut self, _: &Ui<'_>) {
self.ctx = ptr::null();
unsafe { sys::igPopStyleColor(self.count as i32) };
}
@ -236,7 +236,7 @@ pub struct MultiStyleStackToken {
impl MultiStyleStackToken {
/// Pops changes from the style stack
#[doc(alias = "PopStyleVar")]
pub fn pop(mut self, _: &Ui) {
pub fn pop(mut self, _: &Ui<'_>) {
self.ctx = ptr::null();
unsafe { sys::igPopStyleVar(self.count as i32) };
}
@ -380,7 +380,7 @@ pub struct ItemWidthStackToken {
impl ItemWidthStackToken {
/// Pops a change from the item width stack
#[doc(alias = "PopItemWidth")]
pub fn pop(mut self, _: &Ui) {
pub fn pop(mut self, _: &Ui<'_>) {
self._ctx = ptr::null();
unsafe { sys::igPopItemWidth() };
}
@ -394,7 +394,7 @@ pub struct TextWrapPosStackToken {
impl TextWrapPosStackToken {
/// Pops a change from the text wrap position stack
#[doc(alias = "PopTextWrapPos")]
pub fn pop(mut self, _: &Ui) {
pub fn pop(mut self, _: &Ui<'_>) {
self._ctx = ptr::null();
unsafe { sys::igPopTextWrapPos() };
}
@ -410,7 +410,7 @@ impl ItemFlagsStackToken {
/// Pops a change from the item flags stack
#[doc(alias = "PopAllowKeyboardFocus", alias = "PopButtonRepeat")]
pub fn pop(mut self, _: &Ui) {
pub fn pop(mut self, _: &Ui<'_>) {
self._ctx = ptr::null();
const ALLOW_KEYBOARD_FOCUS: ItemFlag = ItemFlag::AllowKeyboardFocus(true);
const BUTTON_REPEAT: ItemFlag = ItemFlag::ButtonRepeat(true);

View File

@ -305,14 +305,14 @@ impl Index<RangeFull> for ImString {
impl fmt::Debug for ImString {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Debug::fmt(self.to_str(), f)
}
}
impl fmt::Display for ImString {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(self.to_str(), f)
}
}
@ -359,14 +359,14 @@ impl<'a> Default for &'a ImStr {
impl fmt::Debug for ImStr {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Debug::fmt(&self.0, f)
}
}
impl fmt::Display for ImStr {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(self.to_str(), f)
}
}

View File

@ -318,7 +318,7 @@ impl<'a, T: AsRef<str> + 'a> ColorEdit<'a, T> {
/// Builds the color editor.
///
/// Returns true if the color value was changed.
pub fn build(mut self, ui: &Ui) -> bool {
pub fn build(mut self, ui: &Ui<'_>) -> bool {
if let EditableColor::Float3(_) = self.value {
self.flags.insert(ColorEditFlags::NO_ALPHA);
}
@ -506,7 +506,7 @@ impl<'a, T: AsRef<str>> ColorPicker<'a, T> {
/// Builds the color picker.
///
/// Returns true if the color value was changed.
pub fn build(mut self, ui: &Ui) -> bool {
pub fn build(mut self, ui: &Ui<'_>) -> bool {
if let EditableColor::Float3(_) = self.value {
self.flags.insert(ColorEditFlags::NO_ALPHA);
}
@ -621,7 +621,7 @@ impl<T: AsRef<str>> ColorButton<T> {
/// Builds the color button.
///
/// Returns true if this color button was clicked.
pub fn build(self, ui: &Ui) -> bool {
pub fn build(self, ui: &Ui<'_>) -> bool {
unsafe {
sys::igColorButton(
ui.scratch_txt(self.desc_id),

View File

@ -162,7 +162,7 @@ impl<T: AsRef<str>, Preview: AsRef<str>> ComboBox<T, Preview> {
/// Returns the result of the closure, if it is called.
///
/// Note: the closure is not called if the combo box is not open.
pub fn build<R, F: FnOnce() -> R>(self, ui: &Ui, f: F) -> Option<R> {
pub fn build<R, F: FnOnce() -> R>(self, ui: &Ui<'_>, f: F) -> Option<R> {
self.begin(ui).map(|_combo| f())
}
}

View File

@ -66,7 +66,7 @@ impl<L: AsRef<str>, T: DataTypeKind, F: AsRef<str>> Drag<T, L, F> {
/// Builds a drag slider that is bound to the given value.
///
/// Returns true if the slider value was changed.
pub fn build(self, ui: &Ui, value: &mut T) -> bool {
pub fn build(self, ui: &Ui<'_>, value: &mut T) -> bool {
unsafe {
let (one, two) = ui.scratch_txt_with_opt(self.label, self.display_format);
@ -91,7 +91,7 @@ impl<L: AsRef<str>, T: DataTypeKind, F: AsRef<str>> Drag<T, L, F> {
/// Builds a horizontal array of multiple drag sliders attached to the given slice.
///
/// Returns true if any slider value was changed.
pub fn build_array(self, ui: &Ui, values: &mut [T]) -> bool {
pub fn build_array(self, ui: &Ui<'_>, values: &mut [T]) -> bool {
unsafe {
let (one, two) = ui.scratch_txt_with_opt(self.label, self.display_format);
@ -208,7 +208,7 @@ where
///
/// Returns true if the slider value was changed.
#[doc(alias = "DragFloatRange2")]
pub fn build(self, ui: &Ui, min: &mut f32, max: &mut f32) -> bool {
pub fn build(self, ui: &Ui<'_>, min: &mut f32, max: &mut f32) -> bool {
let label;
let mut display_format = std::ptr::null();
let mut max_display_format = std::ptr::null();
@ -251,7 +251,7 @@ where
///
/// Returns true if the slider value was changed.
#[doc(alias = "DragIntRange2")]
pub fn build(self, ui: &Ui, min: &mut i32, max: &mut i32) -> bool {
pub fn build(self, ui: &Ui<'_>, min: &mut i32, max: &mut i32) -> bool {
unsafe {
let label;
let mut display_format = std::ptr::null();

View File

@ -55,7 +55,7 @@ impl Image {
self
}
/// Builds the image
pub fn build(self, _: &Ui) {
pub fn build(self, _: &Ui<'_>) {
unsafe {
sys::igImage(
self.texture_id.id() as *mut c_void,
@ -131,7 +131,7 @@ impl ImageButton {
self
}
/// Builds the image button
pub fn build(self, _: &Ui) -> bool {
pub fn build(self, _: &Ui<'_>) -> bool {
unsafe {
sys::igImageButton(
self.texture_id.id() as *mut c_void,

View File

@ -70,7 +70,7 @@ impl<T: AsRef<str>> ListBox<T> {
/// Builds a simple list box for choosing from a slice of values
pub fn build_simple<V, L>(
self,
ui: &Ui,
ui: &Ui<'_>,
current_item: &mut usize,
items: &[V],
label_fn: &L,

View File

@ -167,7 +167,7 @@ impl<Label: AsRef<str>, Shortcut: AsRef<str>> MenuItem<Label, Shortcut> {
///
/// Returns true if the menu item is activated.
#[doc(alias = "MenuItemBool")]
pub fn build(self, ui: &Ui) -> bool {
pub fn build(self, ui: &Ui<'_>) -> bool {
unsafe {
let (label, shortcut) = ui.scratch_txt_with_opt(self.label, self.shortcut);
sys::igMenuItem_Bool(label, shortcut, self.selected, self.enabled)
@ -176,7 +176,7 @@ impl<Label: AsRef<str>, Shortcut: AsRef<str>> MenuItem<Label, Shortcut> {
#[doc(alias = "MenuItemBool")]
/// Builds the menu item using a mutable reference to selected state.
pub fn build_with_ref(self, ui: &Ui, selected: &mut bool) -> bool {
pub fn build_with_ref(self, ui: &Ui<'_>, selected: &mut bool) -> bool {
if self.selected(*selected).build(ui) {
*selected = !*selected;
true

View File

@ -61,7 +61,7 @@ impl<T: AsRef<str>> ProgressBar<T> {
}
/// Builds the progress bar
pub fn build(self, ui: &Ui) {
pub fn build(self, ui: &Ui<'_>) {
unsafe {
sys::igProgressBar(
self.fraction,

View File

@ -107,7 +107,7 @@ impl<T: AsRef<str>> Selectable<T> {
/// Builds the selectable.
///
/// Returns true if the selectable was clicked.
pub fn build(self, ui: &Ui) -> bool {
pub fn build(self, ui: &Ui<'_>) -> bool {
unsafe {
sys::igSelectable_Bool(
ui.scratch_txt(self.label),
@ -119,7 +119,7 @@ impl<T: AsRef<str>> Selectable<T> {
}
/// Builds the selectable using a mutable reference to selected state.
pub fn build_with_ref(self, ui: &Ui, selected: &mut bool) -> bool {
pub fn build_with_ref(self, ui: &Ui<'_>, selected: &mut bool) -> bool {
if self.selected(*selected).build(ui) {
*selected = !*selected;
true

View File

@ -95,7 +95,7 @@ where
/// Builds a slider that is bound to the given value.
///
/// Returns true if the slider value was changed.
pub fn build(self, ui: &Ui, value: &mut Data) -> bool {
pub fn build(self, ui: &Ui<'_>, value: &mut Data) -> bool {
unsafe {
let (label, display_format) = ui.scratch_txt_with_opt(self.label, self.display_format);
@ -113,7 +113,7 @@ where
/// Builds a horizontal array of multiple sliders attached to the given slice.
///
/// Returns true if any slider value was changed.
pub fn build_array(self, ui: &Ui, values: &mut [Data]) -> bool {
pub fn build_array(self, ui: &Ui<'_>, values: &mut [Data]) -> bool {
unsafe {
let (label, display_format) = ui.scratch_txt_with_opt(self.label, self.display_format);
@ -221,7 +221,7 @@ where
/// Builds a vertical slider that is bound to the given value.
///
/// Returns true if the slider value was changed.
pub fn build(self, ui: &Ui, value: &mut Data) -> bool {
pub fn build(self, ui: &Ui<'_>, value: &mut Data) -> bool {
unsafe {
let (label, display_format) = ui.scratch_txt_with_opt(self.label, self.display_format);
@ -325,7 +325,7 @@ where
/// Builds an angle slider that is bound to the given value (in radians).
///
/// Returns true if the slider value was changed.
pub fn build(self, ui: &Ui, value_rad: &mut f32) -> bool {
pub fn build(self, ui: &Ui<'_>, value_rad: &mut f32) -> bool {
unsafe {
let (label, display_format) = ui.scratch_txt_two(self.label, self.display_format);

View File

@ -408,7 +408,7 @@ impl<T: AsRef<str>> CollapsingHeader<T> {
///
/// This is the same as [build](Self::build) but is provided for consistent naming.
#[must_use]
pub fn begin(self, ui: &Ui) -> bool {
pub fn begin(self, ui: &Ui<'_>) -> bool {
self.build(ui)
}
@ -419,7 +419,7 @@ impl<T: AsRef<str>> CollapsingHeader<T> {
/// This is the same as [build_with_close_button](Self::build_with_close_button)
/// but is provided for consistent naming.
#[must_use]
pub fn begin_with_close_button(self, ui: &Ui, opened: &mut bool) -> bool {
pub fn begin_with_close_button(self, ui: &Ui<'_>, opened: &mut bool) -> bool {
self.build_with_close_button(ui, opened)
}
@ -428,7 +428,7 @@ impl<T: AsRef<str>> CollapsingHeader<T> {
/// Returns true if the collapsing header is open and content should be rendered.
#[must_use]
#[inline]
pub fn build(self, ui: &Ui) -> bool {
pub fn build(self, ui: &Ui<'_>) -> bool {
unsafe {
sys::igCollapsingHeader_TreeNodeFlags(
ui.scratch_txt(self.label),
@ -442,7 +442,7 @@ impl<T: AsRef<str>> CollapsingHeader<T> {
/// Returns true if the collapsing header is open and content should be rendered.
#[must_use]
#[inline]
pub fn build_with_close_button(self, ui: &Ui, opened: &mut bool) -> bool {
pub fn build_with_close_button(self, ui: &Ui<'_>, opened: &mut bool) -> bool {
unsafe {
sys::igCollapsingHeader_BoolPtr(
ui.scratch_txt(self.label),