Derive Copy, Clone, Debug for builders whenever possible

This commit is contained in:
Joonas Javanainen 2019-07-13 13:53:24 +03:00
parent baa9362a25
commit 95662e575a
No known key found for this signature in database
GPG Key ID: D39CCA5CB19B9179
6 changed files with 6 additions and 5 deletions

View File

@ -510,7 +510,7 @@ impl<'a> ColorPicker<'a> {
/// ColorButton::new(im_str!("color_button"), [1.0, 0.0, 0.0, 1.0])
/// .build(&ui);
/// ```
#[derive(Debug, Clone)]
#[derive(Copy, Clone, Debug)]
#[must_use]
pub struct ColorButton<'a> {
desc_id: &'a ImStr,

View File

@ -55,7 +55,7 @@ bitflags!(
);
/// Builder for a combo box widget
#[derive(Clone, Debug)]
#[derive(Copy, Clone, Debug)]
#[must_use]
pub struct ComboBox<'a> {
label: &'a ImStr,

View File

@ -17,7 +17,7 @@ use crate::Ui;
/// .overlay_text(im_str!("Progress!"))
/// .build(&ui);
/// ```
#[derive(Debug, Clone)]
#[derive(Copy, Clone, Debug)]
#[must_use]
pub struct ProgressBar<'a> {
fraction: f32,

View File

@ -20,7 +20,7 @@ bitflags!(
);
/// Builder for a selectable widget.
#[derive(Clone, Debug)]
#[derive(Copy, Clone, Debug)]
#[must_use]
pub struct Selectable<'a> {
label: &'a ImStr,

View File

@ -7,7 +7,7 @@ use crate::window::WindowFlags;
use crate::{Id, Ui};
/// Builder for a child window
#[derive(Clone, Debug)]
#[derive(Copy, Clone, Debug)]
#[must_use]
pub struct ChildWindow<'a> {
id: Id<'a>,

View File

@ -148,6 +148,7 @@ impl<'ui> Ui<'ui> {
}
/// Builder for a window
#[derive(Debug)]
#[must_use]
pub struct Window<'a> {
name: &'a ImStr,