Skip to content

Commit

Permalink
Merge pull request gtk-rs#13 from sdroege/once_cell
Browse files Browse the repository at this point in the history
Switch from lazy_static to once_cell
  • Loading branch information
GuillaumeGomez authored Jan 5, 2020
2 parents 5cc23b4 + ff54ac7 commit d29b0d8
Show file tree
Hide file tree
Showing 114 changed files with 636 additions and 4,985 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ matrix:
rust: stable
env: GTK=3.96 FEATURES=
- os: linux
rust: 1.36.0
rust: 1.39.0
env: GTK=3.96 FEATURES=
addons:
apt:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ git = "https://github.com/gtk-rs/lgpl-docs"
[dependencies]
libc = "0.2"
bitflags = "1.0"
lazy_static = "1.0"
once_cell = "1.0"
atk = { git = "https://github.com/gtk-rs/atk" }
atk-sys = { git = "https://github.com/gtk-rs/sys" }
cairo-sys-rs = { git = "https://github.com/gtk-rs/cairo" }
Expand Down
76 changes: 2 additions & 74 deletions src/auto/about_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ impl Default for AboutDialog {
}
}

#[derive(Clone, Default)]
pub struct AboutDialogBuilder {
artists: Option<Vec<String>>,
authors: Option<Vec<String>>,
Expand Down Expand Up @@ -130,80 +131,7 @@ pub struct AboutDialogBuilder {

impl AboutDialogBuilder {
pub fn new() -> Self {
Self {
artists: None,
authors: None,
comments: None,
copyright: None,
documenters: None,
license: None,
license_type: None,
logo: None,
logo_icon_name: None,
program_name: None,
system_information: None,
translator_credits: None,
version: None,
website: None,
website_label: None,
wrap_license: None,
use_header_bar: None,
accept_focus: None,
application: None,
attached_to: None,
decorated: None,
default_height: None,
default_widget: None,
default_width: None,
deletable: None,
destroy_with_parent: None,
display: None,
focus_on_map: None,
focus_visible: None,
hide_on_close: None,
icon_name: None,
mnemonics_visible: None,
modal: None,
resizable: None,
startup_id: None,
title: None,
transient_for: None,
type_: None,
type_hint: None,
window_position: None,
can_focus: None,
can_target: None,
css_name: None,
cursor: None,
expand: None,
focus_on_click: None,
halign: None,
has_focus: None,
has_tooltip: None,
height_request: None,
hexpand: None,
hexpand_set: None,
is_focus: None,
layout_manager: None,
margin: None,
margin_bottom: None,
margin_end: None,
margin_start: None,
margin_top: None,
name: None,
opacity: None,
overflow: None,
receives_default: None,
sensitive: None,
tooltip_markup: None,
tooltip_text: None,
valign: None,
vexpand: None,
vexpand_set: None,
visible: None,
width_request: None,
focus_widget: None,
}
Self::default()
}

pub fn build(self) -> AboutDialog {
Expand Down
39 changes: 2 additions & 37 deletions src/auto/accel_label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ impl AccelLabel {
}
}

#[derive(Clone, Default)]
pub struct AccelLabelBuilder {
accel_closure: Option<glib::Closure>,
accel_widget: Option<Widget>,
Expand Down Expand Up @@ -84,43 +85,7 @@ pub struct AccelLabelBuilder {

impl AccelLabelBuilder {
pub fn new() -> Self {
Self {
accel_closure: None,
accel_widget: None,
label: None,
use_underline: None,
can_focus: None,
can_target: None,
css_name: None,
cursor: None,
expand: None,
focus_on_click: None,
halign: None,
has_focus: None,
has_tooltip: None,
height_request: None,
hexpand: None,
hexpand_set: None,
is_focus: None,
layout_manager: None,
margin: None,
margin_bottom: None,
margin_end: None,
margin_start: None,
margin_top: None,
name: None,
opacity: None,
overflow: None,
receives_default: None,
sensitive: None,
tooltip_markup: None,
tooltip_text: None,
valign: None,
vexpand: None,
vexpand_set: None,
visible: None,
width_request: None,
}
Self::default()
}

pub fn build(self) -> AccelLabel {
Expand Down
36 changes: 2 additions & 34 deletions src/auto/action_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ impl Default for ActionBar {
}
}

#[derive(Clone, Default)]
pub struct ActionBarBuilder {
revealed: Option<bool>,
can_focus: Option<bool>,
Expand Down Expand Up @@ -80,40 +81,7 @@ pub struct ActionBarBuilder {

impl ActionBarBuilder {
pub fn new() -> Self {
Self {
revealed: None,
can_focus: None,
can_target: None,
css_name: None,
cursor: None,
expand: None,
focus_on_click: None,
halign: None,
has_focus: None,
has_tooltip: None,
height_request: None,
hexpand: None,
hexpand_set: None,
is_focus: None,
layout_manager: None,
margin: None,
margin_bottom: None,
margin_end: None,
margin_start: None,
margin_top: None,
name: None,
opacity: None,
overflow: None,
receives_default: None,
sensitive: None,
tooltip_markup: None,
tooltip_text: None,
valign: None,
vexpand: None,
vexpand_set: None,
visible: None,
width_request: None,
}
Self::default()
}

pub fn build(self) -> ActionBar {
Expand Down
39 changes: 2 additions & 37 deletions src/auto/app_chooser_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ impl AppChooserButton {
}
}

#[derive(Clone, Default)]
pub struct AppChooserButtonBuilder {
heading: Option<String>,
show_default_item: Option<bool>,
Expand Down Expand Up @@ -85,43 +86,7 @@ pub struct AppChooserButtonBuilder {

impl AppChooserButtonBuilder {
pub fn new() -> Self {
Self {
heading: None,
show_default_item: None,
show_dialog_item: None,
can_focus: None,
can_target: None,
css_name: None,
cursor: None,
expand: None,
focus_on_click: None,
halign: None,
has_focus: None,
has_tooltip: None,
height_request: None,
hexpand: None,
hexpand_set: None,
is_focus: None,
layout_manager: None,
margin: None,
margin_bottom: None,
margin_end: None,
margin_start: None,
margin_top: None,
name: None,
opacity: None,
overflow: None,
receives_default: None,
sensitive: None,
tooltip_markup: None,
tooltip_text: None,
valign: None,
vexpand: None,
vexpand_set: None,
visible: None,
width_request: None,
content_type: None,
}
Self::default()
}

pub fn build(self) -> AppChooserButton {
Expand Down
63 changes: 2 additions & 61 deletions src/auto/app_chooser_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ impl AppChooserDialog {
}
}

#[derive(Clone, Default)]
pub struct AppChooserDialogBuilder {
gfile: Option<gio::File>,
heading: Option<String>,
Expand Down Expand Up @@ -141,67 +142,7 @@ pub struct AppChooserDialogBuilder {

impl AppChooserDialogBuilder {
pub fn new() -> Self {
Self {
gfile: None,
heading: None,
use_header_bar: None,
accept_focus: None,
application: None,
attached_to: None,
decorated: None,
default_height: None,
default_widget: None,
default_width: None,
deletable: None,
destroy_with_parent: None,
display: None,
focus_on_map: None,
focus_visible: None,
hide_on_close: None,
icon_name: None,
mnemonics_visible: None,
modal: None,
resizable: None,
startup_id: None,
title: None,
transient_for: None,
type_: None,
type_hint: None,
window_position: None,
can_focus: None,
can_target: None,
css_name: None,
cursor: None,
expand: None,
focus_on_click: None,
halign: None,
has_focus: None,
has_tooltip: None,
height_request: None,
hexpand: None,
hexpand_set: None,
is_focus: None,
layout_manager: None,
margin: None,
margin_bottom: None,
margin_end: None,
margin_start: None,
margin_top: None,
name: None,
opacity: None,
overflow: None,
receives_default: None,
sensitive: None,
tooltip_markup: None,
tooltip_text: None,
valign: None,
vexpand: None,
vexpand_set: None,
visible: None,
width_request: None,
focus_widget: None,
content_type: None,
}
Self::default()
}

pub fn build(self) -> AppChooserDialog {
Expand Down
42 changes: 2 additions & 40 deletions src/auto/app_chooser_widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ impl AppChooserWidget {
}
}

#[derive(Clone, Default)]
pub struct AppChooserWidgetBuilder {
default_text: Option<String>,
show_all: Option<bool>,
Expand Down Expand Up @@ -89,46 +90,7 @@ pub struct AppChooserWidgetBuilder {

impl AppChooserWidgetBuilder {
pub fn new() -> Self {
Self {
default_text: None,
show_all: None,
show_default: None,
show_fallback: None,
show_other: None,
show_recommended: None,
can_focus: None,
can_target: None,
css_name: None,
cursor: None,
expand: None,
focus_on_click: None,
halign: None,
has_focus: None,
has_tooltip: None,
height_request: None,
hexpand: None,
hexpand_set: None,
is_focus: None,
layout_manager: None,
margin: None,
margin_bottom: None,
margin_end: None,
margin_start: None,
margin_top: None,
name: None,
opacity: None,
overflow: None,
receives_default: None,
sensitive: None,
tooltip_markup: None,
tooltip_text: None,
valign: None,
vexpand: None,
vexpand_set: None,
visible: None,
width_request: None,
content_type: None,
}
Self::default()
}

pub fn build(self) -> AppChooserWidget {
Expand Down
Loading

0 comments on commit d29b0d8

Please sign in to comment.