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

Commit 921dd31

Browse files
Merge pull request #424 from sdroege/regen
Regen
2 parents caef186 + 0c0f9e6 commit 921dd31

File tree

11 files changed

+30
-58
lines changed

11 files changed

+30
-58
lines changed

src/auto/date_time.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ impl DateTime {
3333
#[cfg(any(feature = "v2_56", feature = "dox"))]
3434
pub fn new_from_iso8601<'a, P: Into<Option<&'a TimeZone>>>(text: &str, default_tz: P) -> DateTime {
3535
let default_tz = default_tz.into();
36-
let default_tz = default_tz.to_glib_none();
3736
unsafe {
38-
from_glib_full(ffi::g_date_time_new_from_iso8601(text.to_glib_none().0, default_tz.0))
37+
from_glib_full(ffi::g_date_time_new_from_iso8601(text.to_glib_none().0, default_tz.to_glib_none().0))
3938
}
4039
}
4140

src/auto/functions.rs

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@ pub fn assertion_message_cmpstr(domain: &str, file: &str, line: i32, func: &str,
5050

5151
pub fn assertion_message_expr<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(domain: P, file: &str, line: i32, func: &str, expr: Q) {
5252
let domain = domain.into();
53-
let domain = domain.to_glib_none();
5453
let expr = expr.into();
55-
let expr = expr.to_glib_none();
5654
unsafe {
57-
ffi::g_assertion_message_expr(domain.0, file.to_glib_none().0, line, func.to_glib_none().0, expr.0);
55+
ffi::g_assertion_message_expr(domain.to_glib_none().0, file.to_glib_none().0, line, func.to_glib_none().0, expr.to_glib_none().0);
5856
}
5957
}
6058

@@ -302,17 +300,15 @@ pub fn compute_hmac_for_string(digest_type: ChecksumType, key: &[u8], str: &str)
302300

303301
pub fn dcgettext<'a, P: Into<Option<&'a str>>>(domain: P, msgid: &str, category: i32) -> Option<GString> {
304302
let domain = domain.into();
305-
let domain = domain.to_glib_none();
306303
unsafe {
307-
from_glib_none(ffi::g_dcgettext(domain.0, msgid.to_glib_none().0, category))
304+
from_glib_none(ffi::g_dcgettext(domain.to_glib_none().0, msgid.to_glib_none().0, category))
308305
}
309306
}
310307

311308
pub fn dgettext<'a, P: Into<Option<&'a str>>>(domain: P, msgid: &str) -> Option<GString> {
312309
let domain = domain.into();
313-
let domain = domain.to_glib_none();
314310
unsafe {
315-
from_glib_none(ffi::g_dgettext(domain.0, msgid.to_glib_none().0))
311+
from_glib_none(ffi::g_dgettext(domain.to_glib_none().0, msgid.to_glib_none().0))
316312
}
317313
}
318314

@@ -326,9 +322,8 @@ pub fn dgettext<'a, P: Into<Option<&'a str>>>(domain: P, msgid: &str) -> Option<
326322

327323
pub fn dngettext<'a, P: Into<Option<&'a str>>>(domain: P, msgid: &str, msgid_plural: &str, n: libc::c_ulong) -> Option<GString> {
328324
let domain = domain.into();
329-
let domain = domain.to_glib_none();
330325
unsafe {
331-
from_glib_none(ffi::g_dngettext(domain.0, msgid.to_glib_none().0, msgid_plural.to_glib_none().0, n))
326+
from_glib_none(ffi::g_dngettext(domain.to_glib_none().0, msgid.to_glib_none().0, msgid_plural.to_glib_none().0, n))
332327
}
333328
}
334329

@@ -342,17 +337,15 @@ pub fn dngettext<'a, P: Into<Option<&'a str>>>(domain: P, msgid: &str, msgid_plu
342337

343338
pub fn dpgettext<'a, P: Into<Option<&'a str>>>(domain: P, msgctxtid: &str, msgidoffset: usize) -> Option<GString> {
344339
let domain = domain.into();
345-
let domain = domain.to_glib_none();
346340
unsafe {
347-
from_glib_none(ffi::g_dpgettext(domain.0, msgctxtid.to_glib_none().0, msgidoffset))
341+
from_glib_none(ffi::g_dpgettext(domain.to_glib_none().0, msgctxtid.to_glib_none().0, msgidoffset))
348342
}
349343
}
350344

351345
pub fn dpgettext2<'a, P: Into<Option<&'a str>>>(domain: P, context: &str, msgid: &str) -> Option<GString> {
352346
let domain = domain.into();
353-
let domain = domain.to_glib_none();
354347
unsafe {
355-
from_glib_none(ffi::g_dpgettext2(domain.0, context.to_glib_none().0, msgid.to_glib_none().0))
348+
from_glib_none(ffi::g_dpgettext2(domain.to_glib_none().0, context.to_glib_none().0, msgid.to_glib_none().0))
356349
}
357350
}
358351

@@ -955,11 +948,9 @@ pub fn reload_user_special_dirs_cache() {
955948

956949
pub fn return_if_fail_warning<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(log_domain: P, pretty_function: &str, expression: Q) {
957950
let log_domain = log_domain.into();
958-
let log_domain = log_domain.to_glib_none();
959951
let expression = expression.into();
960-
let expression = expression.to_glib_none();
961952
unsafe {
962-
ffi::g_return_if_fail_warning(log_domain.0, pretty_function.to_glib_none().0, expression.0);
953+
ffi::g_return_if_fail_warning(log_domain.to_glib_none().0, pretty_function.to_glib_none().0, expression.to_glib_none().0);
963954
}
964955
}
965956

@@ -1180,9 +1171,8 @@ pub fn test_failed() -> bool {
11801171
#[cfg(any(feature = "v2_38", feature = "dox"))]
11811172
pub fn test_incomplete<'a, P: Into<Option<&'a str>>>(msg: P) {
11821173
let msg = msg.into();
1183-
let msg = msg.to_glib_none();
11841174
unsafe {
1185-
ffi::g_test_incomplete(msg.0);
1175+
ffi::g_test_incomplete(msg.to_glib_none().0);
11861176
}
11871177
}
11881178

@@ -1262,9 +1252,8 @@ pub fn test_set_nonfatal_assertions() {
12621252
#[cfg(any(feature = "v2_38", feature = "dox"))]
12631253
pub fn test_skip<'a, P: Into<Option<&'a str>>>(msg: P) {
12641254
let msg = msg.into();
1265-
let msg = msg.to_glib_none();
12661255
unsafe {
1267-
ffi::g_test_skip(msg.0);
1256+
ffi::g_test_skip(msg.to_glib_none().0);
12681257
}
12691258
}
12701259

@@ -1386,9 +1375,8 @@ pub fn unlink<P: AsRef<std::path::Path>>(filename: P) -> i32 {
13861375

13871376
pub fn uri_escape_string<'a, P: Into<Option<&'a str>>>(unescaped: &str, reserved_chars_allowed: P, allow_utf8: bool) -> Option<GString> {
13881377
let reserved_chars_allowed = reserved_chars_allowed.into();
1389-
let reserved_chars_allowed = reserved_chars_allowed.to_glib_none();
13901378
unsafe {
1391-
from_glib_full(ffi::g_uri_escape_string(unescaped.to_glib_none().0, reserved_chars_allowed.0, allow_utf8.to_glib()))
1379+
from_glib_full(ffi::g_uri_escape_string(unescaped.to_glib_none().0, reserved_chars_allowed.to_glib_none().0, allow_utf8.to_glib()))
13921380
}
13931381
}
13941382

@@ -1406,21 +1394,17 @@ pub fn uri_parse_scheme(uri: &str) -> Option<GString> {
14061394

14071395
pub fn uri_unescape_segment<'a, 'b, 'c, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c str>>>(escaped_string: P, escaped_string_end: Q, illegal_characters: R) -> Option<GString> {
14081396
let escaped_string = escaped_string.into();
1409-
let escaped_string = escaped_string.to_glib_none();
14101397
let escaped_string_end = escaped_string_end.into();
1411-
let escaped_string_end = escaped_string_end.to_glib_none();
14121398
let illegal_characters = illegal_characters.into();
1413-
let illegal_characters = illegal_characters.to_glib_none();
14141399
unsafe {
1415-
from_glib_full(ffi::g_uri_unescape_segment(escaped_string.0, escaped_string_end.0, illegal_characters.0))
1400+
from_glib_full(ffi::g_uri_unescape_segment(escaped_string.to_glib_none().0, escaped_string_end.to_glib_none().0, illegal_characters.to_glib_none().0))
14161401
}
14171402
}
14181403

14191404
pub fn uri_unescape_string<'a, P: Into<Option<&'a str>>>(escaped_string: &str, illegal_characters: P) -> Option<GString> {
14201405
let illegal_characters = illegal_characters.into();
1421-
let illegal_characters = illegal_characters.to_glib_none();
14221406
unsafe {
1423-
from_glib_full(ffi::g_uri_unescape_string(escaped_string.to_glib_none().0, illegal_characters.0))
1407+
from_glib_full(ffi::g_uri_unescape_string(escaped_string.to_glib_none().0, illegal_characters.to_glib_none().0))
14241408
}
14251409
}
14261410

@@ -1472,10 +1456,8 @@ pub fn variant_get_gtype() -> types::Type {
14721456

14731457
pub fn warn_message<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(domain: P, file: &str, line: i32, func: &str, warnexpr: Q) {
14741458
let domain = domain.into();
1475-
let domain = domain.to_glib_none();
14761459
let warnexpr = warnexpr.into();
1477-
let warnexpr = warnexpr.to_glib_none();
14781460
unsafe {
1479-
ffi::g_warn_message(domain.0, file.to_glib_none().0, line, func.to_glib_none().0, warnexpr.0);
1461+
ffi::g_warn_message(domain.to_glib_none().0, file.to_glib_none().0, line, func.to_glib_none().0, warnexpr.to_glib_none().0);
14801462
}
14811463
}

src/auto/key_file.rs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ impl KeyFile {
3434

3535
pub fn get_comment<'a, P: Into<Option<&'a str>>>(&self, group_name: P, key: &str) -> Result<GString, Error> {
3636
let group_name = group_name.into();
37-
let group_name = group_name.to_glib_none();
3837
unsafe {
3938
let mut error = ptr::null_mut();
40-
let ret = ffi::g_key_file_get_comment(self.to_glib_none().0, group_name.0, key.to_glib_none().0, &mut error);
39+
let ret = ffi::g_key_file_get_comment(self.to_glib_none().0, group_name.to_glib_none().0, key.to_glib_none().0, &mut error);
4140
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
4241
}
4342
}
@@ -104,29 +103,26 @@ impl KeyFile {
104103
#[cfg(any(feature = "v2_56", feature = "dox"))]
105104
pub fn get_locale_for_key<'a, P: Into<Option<&'a str>>>(&self, group_name: &str, key: &str, locale: P) -> Option<GString> {
106105
let locale = locale.into();
107-
let locale = locale.to_glib_none();
108106
unsafe {
109-
from_glib_full(ffi::g_key_file_get_locale_for_key(self.to_glib_none().0, group_name.to_glib_none().0, key.to_glib_none().0, locale.0))
107+
from_glib_full(ffi::g_key_file_get_locale_for_key(self.to_glib_none().0, group_name.to_glib_none().0, key.to_glib_none().0, locale.to_glib_none().0))
110108
}
111109
}
112110

113111
pub fn get_locale_string<'a, P: Into<Option<&'a str>>>(&self, group_name: &str, key: &str, locale: P) -> Result<GString, Error> {
114112
let locale = locale.into();
115-
let locale = locale.to_glib_none();
116113
unsafe {
117114
let mut error = ptr::null_mut();
118-
let ret = ffi::g_key_file_get_locale_string(self.to_glib_none().0, group_name.to_glib_none().0, key.to_glib_none().0, locale.0, &mut error);
115+
let ret = ffi::g_key_file_get_locale_string(self.to_glib_none().0, group_name.to_glib_none().0, key.to_glib_none().0, locale.to_glib_none().0, &mut error);
119116
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
120117
}
121118
}
122119

123120
pub fn get_locale_string_list<'a, P: Into<Option<&'a str>>>(&self, group_name: &str, key: &str, locale: P) -> Result<Vec<GString>, Error> {
124121
let locale = locale.into();
125-
let locale = locale.to_glib_none();
126122
unsafe {
127123
let mut length = mem::uninitialized();
128124
let mut error = ptr::null_mut();
129-
let ret = ffi::g_key_file_get_locale_string_list(self.to_glib_none().0, group_name.to_glib_none().0, key.to_glib_none().0, locale.0, &mut length, &mut error);
125+
let ret = ffi::g_key_file_get_locale_string_list(self.to_glib_none().0, group_name.to_glib_none().0, key.to_glib_none().0, locale.to_glib_none().0, &mut length, &mut error);
130126
if error.is_null() { Ok(FromGlibContainer::from_glib_full_num(ret, length as usize)) } else { Err(from_glib_full(error)) }
131127
}
132128
}
@@ -204,12 +200,10 @@ impl KeyFile {
204200

205201
pub fn remove_comment<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(&self, group_name: P, key: Q) -> Result<(), Error> {
206202
let group_name = group_name.into();
207-
let group_name = group_name.to_glib_none();
208203
let key = key.into();
209-
let key = key.to_glib_none();
210204
unsafe {
211205
let mut error = ptr::null_mut();
212-
let _ = ffi::g_key_file_remove_comment(self.to_glib_none().0, group_name.0, key.0, &mut error);
206+
let _ = ffi::g_key_file_remove_comment(self.to_glib_none().0, group_name.to_glib_none().0, key.to_glib_none().0, &mut error);
213207
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
214208
}
215209
}
@@ -242,12 +236,10 @@ impl KeyFile {
242236

243237
pub fn set_comment<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(&self, group_name: P, key: Q, comment: &str) -> Result<(), Error> {
244238
let group_name = group_name.into();
245-
let group_name = group_name.to_glib_none();
246239
let key = key.into();
247-
let key = key.to_glib_none();
248240
unsafe {
249241
let mut error = ptr::null_mut();
250-
let _ = ffi::g_key_file_set_comment(self.to_glib_none().0, group_name.0, key.0, comment.to_glib_none().0, &mut error);
242+
let _ = ffi::g_key_file_set_comment(self.to_glib_none().0, group_name.to_glib_none().0, key.to_glib_none().0, comment.to_glib_none().0, &mut error);
251243
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
252244
}
253245
}

src/auto/main_loop.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ glib_wrapper! {
2020
impl MainLoop {
2121
pub fn new<'a, P: Into<Option<&'a MainContext>>>(context: P, is_running: bool) -> MainLoop {
2222
let context = context.into();
23-
let context = context.to_glib_none();
2423
unsafe {
25-
from_glib_full(ffi::g_main_loop_new(context.0, is_running.to_glib()))
24+
from_glib_full(ffi::g_main_loop_new(context.to_glib_none().0, is_running.to_glib()))
2625
}
2726
}
2827

src/auto/source.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ impl Source {
4040

4141
pub fn attach<'a, P: Into<Option<&'a MainContext>>>(&self, context: P) -> u32 {
4242
let context = context.into();
43-
let context = context.to_glib_none();
4443
unsafe {
45-
ffi::g_source_attach(self.to_glib_none().0, context.0)
44+
ffi::g_source_attach(self.to_glib_none().0, context.to_glib_none().0)
4645
}
4746
}
4847

src/auto/time_zone.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ glib_wrapper! {
2121
impl TimeZone {
2222
pub fn new<'a, P: Into<Option<&'a str>>>(identifier: P) -> TimeZone {
2323
let identifier = identifier.into();
24-
let identifier = identifier.to_glib_none();
2524
unsafe {
26-
from_glib_full(ffi::g_time_zone_new(identifier.0))
25+
from_glib_full(ffi::g_time_zone_new(identifier.to_glib_none().0))
2726
}
2827
}
2928

src/auto/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ c5498ac)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ c49dfc7)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 3766446)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 62f3bf0)

src/gobject/auto/binding.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ impl Binding {
5959
unsafe impl Send for Binding {}
6060
unsafe impl Sync for Binding {}
6161

62+
pub const NONE_BINDING: Option<&Binding> = None;
63+
6264
impl fmt::Display for Binding {
6365
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6466
write!(f, "Binding")

0 commit comments

Comments
 (0)