Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 05f068b

Browse files
committed
Run everything through rustfmt
1 parent 5a3e205 commit 05f068b

Some content is hidden

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

45 files changed

+3222
-1653
lines changed

src/auto/checksum.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// from gir-files (https://github.com/gtk-rs/gir-files)
33
// DO NOT EDIT
44

5-
use ChecksumType;
65
use glib_sys;
76
use translate::*;
7+
use ChecksumType;
88

99
glib_wrapper! {
1010
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
@@ -19,9 +19,7 @@ glib_wrapper! {
1919

2020
impl Checksum {
2121
pub fn new(checksum_type: ChecksumType) -> Checksum {
22-
unsafe {
23-
from_glib_full(glib_sys::g_checksum_new(checksum_type.to_glib()))
24-
}
22+
unsafe { from_glib_full(glib_sys::g_checksum_new(checksum_type.to_glib())) }
2523
}
2624

2725
pub fn reset(&mut self) {
@@ -38,9 +36,7 @@ impl Checksum {
3836
}
3937

4038
pub fn type_get_length(checksum_type: ChecksumType) -> isize {
41-
unsafe {
42-
glib_sys::g_checksum_type_get_length(checksum_type.to_glib())
43-
}
39+
unsafe { glib_sys::g_checksum_type_get_length(checksum_type.to_glib()) }
4440
}
4541
}
4642

src/auto/constants.rs

Lines changed: 168 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,110 +6,242 @@ use glib_sys;
66
use std::ffi::CStr;
77

88
lazy_static! {
9-
pub static ref CSET_A_2_Z: &'static str = unsafe{CStr::from_ptr(glib_sys::G_CSET_A_2_Z).to_str().unwrap()};
9+
pub static ref CSET_A_2_Z: &'static str =
10+
unsafe { CStr::from_ptr(glib_sys::G_CSET_A_2_Z).to_str().unwrap() };
1011
}
1112
lazy_static! {
12-
pub static ref CSET_DIGITS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_CSET_DIGITS).to_str().unwrap()};
13+
pub static ref CSET_DIGITS: &'static str =
14+
unsafe { CStr::from_ptr(glib_sys::G_CSET_DIGITS).to_str().unwrap() };
1315
}
1416
lazy_static! {
15-
pub static ref CSET_a_2_z: &'static str = unsafe{CStr::from_ptr(glib_sys::G_CSET_a_2_z).to_str().unwrap()};
17+
pub static ref CSET_a_2_z: &'static str =
18+
unsafe { CStr::from_ptr(glib_sys::G_CSET_a_2_z).to_str().unwrap() };
1619
}
1720
lazy_static! {
18-
pub static ref KEY_FILE_DESKTOP_ACTION_GROUP_PREFIX: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_ACTION_GROUP_PREFIX).to_str().unwrap()};
21+
pub static ref KEY_FILE_DESKTOP_ACTION_GROUP_PREFIX: &'static str = unsafe {
22+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_ACTION_GROUP_PREFIX)
23+
.to_str()
24+
.unwrap()
25+
};
1926
}
2027
lazy_static! {
21-
pub static ref KEY_FILE_DESKTOP_GROUP: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_GROUP).to_str().unwrap()};
28+
pub static ref KEY_FILE_DESKTOP_GROUP: &'static str = unsafe {
29+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_GROUP)
30+
.to_str()
31+
.unwrap()
32+
};
2233
}
2334
lazy_static! {
24-
pub static ref KEY_FILE_DESKTOP_KEY_ACTIONS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_ACTIONS).to_str().unwrap()};
35+
pub static ref KEY_FILE_DESKTOP_KEY_ACTIONS: &'static str = unsafe {
36+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_ACTIONS)
37+
.to_str()
38+
.unwrap()
39+
};
2540
}
2641
lazy_static! {
27-
pub static ref KEY_FILE_DESKTOP_KEY_CATEGORIES: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_CATEGORIES).to_str().unwrap()};
42+
pub static ref KEY_FILE_DESKTOP_KEY_CATEGORIES: &'static str = unsafe {
43+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_CATEGORIES)
44+
.to_str()
45+
.unwrap()
46+
};
2847
}
2948
lazy_static! {
30-
pub static ref KEY_FILE_DESKTOP_KEY_COMMENT: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_COMMENT).to_str().unwrap()};
49+
pub static ref KEY_FILE_DESKTOP_KEY_COMMENT: &'static str = unsafe {
50+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_COMMENT)
51+
.to_str()
52+
.unwrap()
53+
};
3154
}
3255
lazy_static! {
33-
pub static ref KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE).to_str().unwrap()};
56+
pub static ref KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE: &'static str = unsafe {
57+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE)
58+
.to_str()
59+
.unwrap()
60+
};
3461
}
3562
lazy_static! {
36-
pub static ref KEY_FILE_DESKTOP_KEY_EXEC: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_EXEC).to_str().unwrap()};
63+
pub static ref KEY_FILE_DESKTOP_KEY_EXEC: &'static str = unsafe {
64+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_EXEC)
65+
.to_str()
66+
.unwrap()
67+
};
3768
}
3869
lazy_static! {
39-
pub static ref KEY_FILE_DESKTOP_KEY_FULLNAME: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_FULLNAME).to_str().unwrap()};
70+
pub static ref KEY_FILE_DESKTOP_KEY_FULLNAME: &'static str = unsafe {
71+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_FULLNAME)
72+
.to_str()
73+
.unwrap()
74+
};
4075
}
4176
lazy_static! {
42-
pub static ref KEY_FILE_DESKTOP_KEY_GENERIC_NAME: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME).to_str().unwrap()};
77+
pub static ref KEY_FILE_DESKTOP_KEY_GENERIC_NAME: &'static str = unsafe {
78+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME)
79+
.to_str()
80+
.unwrap()
81+
};
4382
}
4483
lazy_static! {
45-
pub static ref KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN).to_str().unwrap()};
84+
pub static ref KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN: &'static str = unsafe {
85+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN)
86+
.to_str()
87+
.unwrap()
88+
};
4689
}
4790
lazy_static! {
48-
pub static ref KEY_FILE_DESKTOP_KEY_HIDDEN: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_HIDDEN).to_str().unwrap()};
91+
pub static ref KEY_FILE_DESKTOP_KEY_HIDDEN: &'static str = unsafe {
92+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_HIDDEN)
93+
.to_str()
94+
.unwrap()
95+
};
4996
}
5097
lazy_static! {
51-
pub static ref KEY_FILE_DESKTOP_KEY_ICON: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_ICON).to_str().unwrap()};
98+
pub static ref KEY_FILE_DESKTOP_KEY_ICON: &'static str = unsafe {
99+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_ICON)
100+
.to_str()
101+
.unwrap()
102+
};
52103
}
53104
lazy_static! {
54-
pub static ref KEY_FILE_DESKTOP_KEY_KEYWORDS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_KEYWORDS).to_str().unwrap()};
105+
pub static ref KEY_FILE_DESKTOP_KEY_KEYWORDS: &'static str = unsafe {
106+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_KEYWORDS)
107+
.to_str()
108+
.unwrap()
109+
};
55110
}
56111
lazy_static! {
57-
pub static ref KEY_FILE_DESKTOP_KEY_MIME_TYPE: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_MIME_TYPE).to_str().unwrap()};
112+
pub static ref KEY_FILE_DESKTOP_KEY_MIME_TYPE: &'static str = unsafe {
113+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_MIME_TYPE)
114+
.to_str()
115+
.unwrap()
116+
};
58117
}
59118
lazy_static! {
60-
pub static ref KEY_FILE_DESKTOP_KEY_NAME: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_NAME).to_str().unwrap()};
119+
pub static ref KEY_FILE_DESKTOP_KEY_NAME: &'static str = unsafe {
120+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_NAME)
121+
.to_str()
122+
.unwrap()
123+
};
61124
}
62125
lazy_static! {
63-
pub static ref KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN).to_str().unwrap()};
126+
pub static ref KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN: &'static str = unsafe {
127+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN)
128+
.to_str()
129+
.unwrap()
130+
};
64131
}
65132
lazy_static! {
66-
pub static ref KEY_FILE_DESKTOP_KEY_NO_DISPLAY: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY).to_str().unwrap()};
133+
pub static ref KEY_FILE_DESKTOP_KEY_NO_DISPLAY: &'static str = unsafe {
134+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY)
135+
.to_str()
136+
.unwrap()
137+
};
67138
}
68139
lazy_static! {
69-
pub static ref KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN).to_str().unwrap()};
140+
pub static ref KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN: &'static str = unsafe {
141+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN)
142+
.to_str()
143+
.unwrap()
144+
};
70145
}
71146
lazy_static! {
72-
pub static ref KEY_FILE_DESKTOP_KEY_PATH: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_PATH).to_str().unwrap()};
147+
pub static ref KEY_FILE_DESKTOP_KEY_PATH: &'static str = unsafe {
148+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_PATH)
149+
.to_str()
150+
.unwrap()
151+
};
73152
}
74153
lazy_static! {
75-
pub static ref KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY).to_str().unwrap()};
154+
pub static ref KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY: &'static str = unsafe {
155+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY)
156+
.to_str()
157+
.unwrap()
158+
};
76159
}
77160
lazy_static! {
78-
pub static ref KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS).to_str().unwrap()};
161+
pub static ref KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS: &'static str = unsafe {
162+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS)
163+
.to_str()
164+
.unwrap()
165+
};
79166
}
80167
lazy_static! {
81-
pub static ref KEY_FILE_DESKTOP_KEY_TERMINAL: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_TERMINAL).to_str().unwrap()};
168+
pub static ref KEY_FILE_DESKTOP_KEY_TERMINAL: &'static str = unsafe {
169+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_TERMINAL)
170+
.to_str()
171+
.unwrap()
172+
};
82173
}
83174
lazy_static! {
84-
pub static ref KEY_FILE_DESKTOP_KEY_TRY_EXEC: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_TRY_EXEC).to_str().unwrap()};
175+
pub static ref KEY_FILE_DESKTOP_KEY_TRY_EXEC: &'static str = unsafe {
176+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_TRY_EXEC)
177+
.to_str()
178+
.unwrap()
179+
};
85180
}
86181
lazy_static! {
87-
pub static ref KEY_FILE_DESKTOP_KEY_TYPE: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_TYPE).to_str().unwrap()};
182+
pub static ref KEY_FILE_DESKTOP_KEY_TYPE: &'static str = unsafe {
183+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_TYPE)
184+
.to_str()
185+
.unwrap()
186+
};
88187
}
89188
lazy_static! {
90-
pub static ref KEY_FILE_DESKTOP_KEY_URL: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_URL).to_str().unwrap()};
189+
pub static ref KEY_FILE_DESKTOP_KEY_URL: &'static str = unsafe {
190+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_URL)
191+
.to_str()
192+
.unwrap()
193+
};
91194
}
92195
lazy_static! {
93-
pub static ref KEY_FILE_DESKTOP_KEY_VERSION: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_VERSION).to_str().unwrap()};
196+
pub static ref KEY_FILE_DESKTOP_KEY_VERSION: &'static str = unsafe {
197+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_VERSION)
198+
.to_str()
199+
.unwrap()
200+
};
94201
}
95202
lazy_static! {
96-
pub static ref KEY_FILE_DESKTOP_TYPE_APPLICATION: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_TYPE_APPLICATION).to_str().unwrap()};
203+
pub static ref KEY_FILE_DESKTOP_TYPE_APPLICATION: &'static str = unsafe {
204+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_TYPE_APPLICATION)
205+
.to_str()
206+
.unwrap()
207+
};
97208
}
98209
lazy_static! {
99-
pub static ref KEY_FILE_DESKTOP_TYPE_DIRECTORY: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_TYPE_DIRECTORY).to_str().unwrap()};
210+
pub static ref KEY_FILE_DESKTOP_TYPE_DIRECTORY: &'static str = unsafe {
211+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_TYPE_DIRECTORY)
212+
.to_str()
213+
.unwrap()
214+
};
100215
}
101216
lazy_static! {
102-
pub static ref KEY_FILE_DESKTOP_TYPE_LINK: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_TYPE_LINK).to_str().unwrap()};
217+
pub static ref KEY_FILE_DESKTOP_TYPE_LINK: &'static str = unsafe {
218+
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_TYPE_LINK)
219+
.to_str()
220+
.unwrap()
221+
};
103222
}
104223
lazy_static! {
105-
pub static ref OPTION_REMAINING: &'static str = unsafe{CStr::from_ptr(glib_sys::G_OPTION_REMAINING).to_str().unwrap()};
224+
pub static ref OPTION_REMAINING: &'static str = unsafe {
225+
CStr::from_ptr(glib_sys::G_OPTION_REMAINING)
226+
.to_str()
227+
.unwrap()
228+
};
106229
}
107230
lazy_static! {
108-
pub static ref STR_DELIMITERS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_STR_DELIMITERS).to_str().unwrap()};
231+
pub static ref STR_DELIMITERS: &'static str =
232+
unsafe { CStr::from_ptr(glib_sys::G_STR_DELIMITERS).to_str().unwrap() };
109233
}
110234
lazy_static! {
111-
pub static ref URI_RESERVED_CHARS_GENERIC_DELIMITERS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_URI_RESERVED_CHARS_GENERIC_DELIMITERS).to_str().unwrap()};
235+
pub static ref URI_RESERVED_CHARS_GENERIC_DELIMITERS: &'static str = unsafe {
236+
CStr::from_ptr(glib_sys::G_URI_RESERVED_CHARS_GENERIC_DELIMITERS)
237+
.to_str()
238+
.unwrap()
239+
};
112240
}
113241
lazy_static! {
114-
pub static ref URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS).to_str().unwrap()};
242+
pub static ref URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS: &'static str = unsafe {
243+
CStr::from_ptr(glib_sys::G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS)
244+
.to_str()
245+
.unwrap()
246+
};
115247
}

0 commit comments

Comments
 (0)