Skip to content

Commit d29b0d8

Browse files
Merge pull request gtk-rs#13 from sdroege/once_cell
Switch from lazy_static to once_cell
2 parents 5cc23b4 + ff54ac7 commit d29b0d8

File tree

114 files changed

+636
-4985
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+636
-4985
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ matrix:
1212
rust: stable
1313
env: GTK=3.96 FEATURES=
1414
- os: linux
15-
rust: 1.36.0
15+
rust: 1.39.0
1616
env: GTK=3.96 FEATURES=
1717
addons:
1818
apt:

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ git = "https://github.com/gtk-rs/lgpl-docs"
3838
[dependencies]
3939
libc = "0.2"
4040
bitflags = "1.0"
41-
lazy_static = "1.0"
41+
once_cell = "1.0"
4242
atk = { git = "https://github.com/gtk-rs/atk" }
4343
atk-sys = { git = "https://github.com/gtk-rs/sys" }
4444
cairo-sys-rs = { git = "https://github.com/gtk-rs/cairo" }

src/auto/about_dialog.rs

+2-74
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ impl Default for AboutDialog {
5353
}
5454
}
5555

56+
#[derive(Clone, Default)]
5657
pub struct AboutDialogBuilder {
5758
artists: Option<Vec<String>>,
5859
authors: Option<Vec<String>>,
@@ -130,80 +131,7 @@ pub struct AboutDialogBuilder {
130131

131132
impl AboutDialogBuilder {
132133
pub fn new() -> Self {
133-
Self {
134-
artists: None,
135-
authors: None,
136-
comments: None,
137-
copyright: None,
138-
documenters: None,
139-
license: None,
140-
license_type: None,
141-
logo: None,
142-
logo_icon_name: None,
143-
program_name: None,
144-
system_information: None,
145-
translator_credits: None,
146-
version: None,
147-
website: None,
148-
website_label: None,
149-
wrap_license: None,
150-
use_header_bar: None,
151-
accept_focus: None,
152-
application: None,
153-
attached_to: None,
154-
decorated: None,
155-
default_height: None,
156-
default_widget: None,
157-
default_width: None,
158-
deletable: None,
159-
destroy_with_parent: None,
160-
display: None,
161-
focus_on_map: None,
162-
focus_visible: None,
163-
hide_on_close: None,
164-
icon_name: None,
165-
mnemonics_visible: None,
166-
modal: None,
167-
resizable: None,
168-
startup_id: None,
169-
title: None,
170-
transient_for: None,
171-
type_: None,
172-
type_hint: None,
173-
window_position: None,
174-
can_focus: None,
175-
can_target: None,
176-
css_name: None,
177-
cursor: None,
178-
expand: None,
179-
focus_on_click: None,
180-
halign: None,
181-
has_focus: None,
182-
has_tooltip: None,
183-
height_request: None,
184-
hexpand: None,
185-
hexpand_set: None,
186-
is_focus: None,
187-
layout_manager: None,
188-
margin: None,
189-
margin_bottom: None,
190-
margin_end: None,
191-
margin_start: None,
192-
margin_top: None,
193-
name: None,
194-
opacity: None,
195-
overflow: None,
196-
receives_default: None,
197-
sensitive: None,
198-
tooltip_markup: None,
199-
tooltip_text: None,
200-
valign: None,
201-
vexpand: None,
202-
vexpand_set: None,
203-
visible: None,
204-
width_request: None,
205-
focus_widget: None,
206-
}
134+
Self::default()
207135
}
208136

209137
pub fn build(self) -> AboutDialog {

src/auto/accel_label.rs

+2-37
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ impl AccelLabel {
4444
}
4545
}
4646

47+
#[derive(Clone, Default)]
4748
pub struct AccelLabelBuilder {
4849
accel_closure: Option<glib::Closure>,
4950
accel_widget: Option<Widget>,
@@ -84,43 +85,7 @@ pub struct AccelLabelBuilder {
8485

8586
impl AccelLabelBuilder {
8687
pub fn new() -> Self {
87-
Self {
88-
accel_closure: None,
89-
accel_widget: None,
90-
label: None,
91-
use_underline: None,
92-
can_focus: None,
93-
can_target: None,
94-
css_name: None,
95-
cursor: None,
96-
expand: None,
97-
focus_on_click: None,
98-
halign: None,
99-
has_focus: None,
100-
has_tooltip: None,
101-
height_request: None,
102-
hexpand: None,
103-
hexpand_set: None,
104-
is_focus: None,
105-
layout_manager: None,
106-
margin: None,
107-
margin_bottom: None,
108-
margin_end: None,
109-
margin_start: None,
110-
margin_top: None,
111-
name: None,
112-
opacity: None,
113-
overflow: None,
114-
receives_default: None,
115-
sensitive: None,
116-
tooltip_markup: None,
117-
tooltip_text: None,
118-
valign: None,
119-
vexpand: None,
120-
vexpand_set: None,
121-
visible: None,
122-
width_request: None,
123-
}
88+
Self::default()
12489
}
12590

12691
pub fn build(self) -> AccelLabel {

src/auto/action_bar.rs

+2-34
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ impl Default for ActionBar {
4343
}
4444
}
4545

46+
#[derive(Clone, Default)]
4647
pub struct ActionBarBuilder {
4748
revealed: Option<bool>,
4849
can_focus: Option<bool>,
@@ -80,40 +81,7 @@ pub struct ActionBarBuilder {
8081

8182
impl ActionBarBuilder {
8283
pub fn new() -> Self {
83-
Self {
84-
revealed: None,
85-
can_focus: None,
86-
can_target: None,
87-
css_name: None,
88-
cursor: None,
89-
expand: None,
90-
focus_on_click: None,
91-
halign: None,
92-
has_focus: None,
93-
has_tooltip: None,
94-
height_request: None,
95-
hexpand: None,
96-
hexpand_set: None,
97-
is_focus: None,
98-
layout_manager: None,
99-
margin: None,
100-
margin_bottom: None,
101-
margin_end: None,
102-
margin_start: None,
103-
margin_top: None,
104-
name: None,
105-
opacity: None,
106-
overflow: None,
107-
receives_default: None,
108-
sensitive: None,
109-
tooltip_markup: None,
110-
tooltip_text: None,
111-
valign: None,
112-
vexpand: None,
113-
vexpand_set: None,
114-
visible: None,
115-
width_request: None,
116-
}
84+
Self::default()
11785
}
11886

11987
pub fn build(self) -> ActionBar {

src/auto/app_chooser_button.rs

+2-37
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ impl AppChooserButton {
4545
}
4646
}
4747

48+
#[derive(Clone, Default)]
4849
pub struct AppChooserButtonBuilder {
4950
heading: Option<String>,
5051
show_default_item: Option<bool>,
@@ -85,43 +86,7 @@ pub struct AppChooserButtonBuilder {
8586

8687
impl AppChooserButtonBuilder {
8788
pub fn new() -> Self {
88-
Self {
89-
heading: None,
90-
show_default_item: None,
91-
show_dialog_item: None,
92-
can_focus: None,
93-
can_target: None,
94-
css_name: None,
95-
cursor: None,
96-
expand: None,
97-
focus_on_click: None,
98-
halign: None,
99-
has_focus: None,
100-
has_tooltip: None,
101-
height_request: None,
102-
hexpand: None,
103-
hexpand_set: None,
104-
is_focus: None,
105-
layout_manager: None,
106-
margin: None,
107-
margin_bottom: None,
108-
margin_end: None,
109-
margin_start: None,
110-
margin_top: None,
111-
name: None,
112-
opacity: None,
113-
overflow: None,
114-
receives_default: None,
115-
sensitive: None,
116-
tooltip_markup: None,
117-
tooltip_text: None,
118-
valign: None,
119-
vexpand: None,
120-
vexpand_set: None,
121-
visible: None,
122-
width_request: None,
123-
content_type: None,
124-
}
89+
Self::default()
12590
}
12691

12792
pub fn build(self) -> AppChooserButton {

src/auto/app_chooser_dialog.rs

+2-61
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ impl AppChooserDialog {
7777
}
7878
}
7979

80+
#[derive(Clone, Default)]
8081
pub struct AppChooserDialogBuilder {
8182
gfile: Option<gio::File>,
8283
heading: Option<String>,
@@ -141,67 +142,7 @@ pub struct AppChooserDialogBuilder {
141142

142143
impl AppChooserDialogBuilder {
143144
pub fn new() -> Self {
144-
Self {
145-
gfile: None,
146-
heading: None,
147-
use_header_bar: None,
148-
accept_focus: None,
149-
application: None,
150-
attached_to: None,
151-
decorated: None,
152-
default_height: None,
153-
default_widget: None,
154-
default_width: None,
155-
deletable: None,
156-
destroy_with_parent: None,
157-
display: None,
158-
focus_on_map: None,
159-
focus_visible: None,
160-
hide_on_close: None,
161-
icon_name: None,
162-
mnemonics_visible: None,
163-
modal: None,
164-
resizable: None,
165-
startup_id: None,
166-
title: None,
167-
transient_for: None,
168-
type_: None,
169-
type_hint: None,
170-
window_position: None,
171-
can_focus: None,
172-
can_target: None,
173-
css_name: None,
174-
cursor: None,
175-
expand: None,
176-
focus_on_click: None,
177-
halign: None,
178-
has_focus: None,
179-
has_tooltip: None,
180-
height_request: None,
181-
hexpand: None,
182-
hexpand_set: None,
183-
is_focus: None,
184-
layout_manager: None,
185-
margin: None,
186-
margin_bottom: None,
187-
margin_end: None,
188-
margin_start: None,
189-
margin_top: None,
190-
name: None,
191-
opacity: None,
192-
overflow: None,
193-
receives_default: None,
194-
sensitive: None,
195-
tooltip_markup: None,
196-
tooltip_text: None,
197-
valign: None,
198-
vexpand: None,
199-
vexpand_set: None,
200-
visible: None,
201-
width_request: None,
202-
focus_widget: None,
203-
content_type: None,
204-
}
145+
Self::default()
205146
}
206147

207148
pub fn build(self) -> AppChooserDialog {

src/auto/app_chooser_widget.rs

+2-40
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ impl AppChooserWidget {
4646
}
4747
}
4848

49+
#[derive(Clone, Default)]
4950
pub struct AppChooserWidgetBuilder {
5051
default_text: Option<String>,
5152
show_all: Option<bool>,
@@ -89,46 +90,7 @@ pub struct AppChooserWidgetBuilder {
8990

9091
impl AppChooserWidgetBuilder {
9192
pub fn new() -> Self {
92-
Self {
93-
default_text: None,
94-
show_all: None,
95-
show_default: None,
96-
show_fallback: None,
97-
show_other: None,
98-
show_recommended: None,
99-
can_focus: None,
100-
can_target: None,
101-
css_name: None,
102-
cursor: None,
103-
expand: None,
104-
focus_on_click: None,
105-
halign: None,
106-
has_focus: None,
107-
has_tooltip: None,
108-
height_request: None,
109-
hexpand: None,
110-
hexpand_set: None,
111-
is_focus: None,
112-
layout_manager: None,
113-
margin: None,
114-
margin_bottom: None,
115-
margin_end: None,
116-
margin_start: None,
117-
margin_top: None,
118-
name: None,
119-
opacity: None,
120-
overflow: None,
121-
receives_default: None,
122-
sensitive: None,
123-
tooltip_markup: None,
124-
tooltip_text: None,
125-
valign: None,
126-
vexpand: None,
127-
vexpand_set: None,
128-
visible: None,
129-
width_request: None,
130-
content_type: None,
131-
}
93+
Self::default()
13294
}
13395

13496
pub fn build(self) -> AppChooserWidget {

0 commit comments

Comments
 (0)