From 5e5fd4f9a79a2d219d7f966a39f620ec3cd64d21 Mon Sep 17 00:00:00 2001 From: Evgenii Pashkin Date: Sat, 4 Nov 2017 17:31:44 +0300 Subject: [PATCH 1/2] Update submodules --- gir | 2 +- gir-files | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gir b/gir index 0fe730d9..94e079d4 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit 0fe730d9547f263ef5a3fdae9f00e06e64875d3b +Subproject commit 94e079d4a27cdc06567f273046cdc14e7a4c8640 diff --git a/gir-files b/gir-files index db49619c..469db101 160000 --- a/gir-files +++ b/gir-files @@ -1 +1 @@ -Subproject commit db49619c9e2c4ad7484f77fdf9fe02c4b728f01e +Subproject commit 469db1018320ebda8f82b144e411fba8b2373549 From fa629ba43022c7486a60f7d2c29a8bf9bf9bf438 Mon Sep 17 00:00:00 2001 From: Evgenii Pashkin Date: Sat, 4 Nov 2017 17:31:54 +0300 Subject: [PATCH 2/2] Regen --- src/auto/alias.rs | 2 +- src/auto/checksum.rs | 2 +- src/auto/date_time.rs | 2 +- src/auto/enums.rs | 25 ++++++++++++------------- src/auto/flags.rs | 2 +- src/auto/functions.rs | 2 +- src/auto/key_file.rs | 2 +- src/auto/main_context.rs | 2 +- src/auto/main_loop.rs | 2 +- src/auto/mod.rs | 2 +- src/auto/source.rs | 2 +- src/auto/time_zone.rs | 2 +- src/variant.rs | 2 +- 13 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/auto/alias.rs b/src/auto/alias.rs index 172b6333..a953c255 100644 --- a/src/auto/alias.rs +++ b/src/auto/alias.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (0fe730d) from gir-files (db49619) +// This file was generated by gir (94e079d) from gir-files (469db10) // DO NOT EDIT #[allow(unused_imports)] diff --git a/src/auto/checksum.rs b/src/auto/checksum.rs index b503663b..dc87b909 100644 --- a/src/auto/checksum.rs +++ b/src/auto/checksum.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (0fe730d) from gir-files (db49619) +// This file was generated by gir (94e079d) from gir-files (469db10) // DO NOT EDIT use ChecksumType; diff --git a/src/auto/date_time.rs b/src/auto/date_time.rs index eb4df57d..8ff51655 100644 --- a/src/auto/date_time.rs +++ b/src/auto/date_time.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (0fe730d) from gir-files (db49619) +// This file was generated by gir (94e079d) from gir-files (469db10) // DO NOT EDIT use TimeSpan; diff --git a/src/auto/enums.rs b/src/auto/enums.rs index d7a26d55..a4111674 100644 --- a/src/auto/enums.rs +++ b/src/auto/enums.rs @@ -1,11 +1,10 @@ -// This file was generated by gir (0fe730d) from gir-files (db49619) +// This file was generated by gir (94e079d) from gir-files (469db10) // DO NOT EDIT use ffi; use ffi as glib_ffi; use error::ErrorDomain; use translate::*; -use std; #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pub enum ChecksumType { @@ -33,7 +32,7 @@ impl ToGlib for ChecksumType { ChecksumType::Sha512 => ffi::G_CHECKSUM_SHA512, #[cfg(any(feature = "v2_52", feature = "dox"))] ChecksumType::Sha384 => ffi::G_CHECKSUM_SHA384, - ChecksumType::__Unknown(value) => unsafe{std::mem::transmute(value)} + ChecksumType::__Unknown(value) => value } } } @@ -41,7 +40,7 @@ impl ToGlib for ChecksumType { #[doc(hidden)] impl FromGlib for ChecksumType { fn from_glib(value: ffi::GChecksumType) -> Self { - match value as i32 { + match value { 0 => ChecksumType::Md5, 1 => ChecksumType::Sha1, 2 => ChecksumType::Sha256, @@ -92,7 +91,7 @@ impl ToGlib for DateMonth { DateMonth::October => ffi::G_DATE_OCTOBER, DateMonth::November => ffi::G_DATE_NOVEMBER, DateMonth::December => ffi::G_DATE_DECEMBER, - DateMonth::__Unknown(value) => unsafe{std::mem::transmute(value)} + DateMonth::__Unknown(value) => value } } } @@ -100,7 +99,7 @@ impl ToGlib for DateMonth { #[doc(hidden)] impl FromGlib for DateMonth { fn from_glib(value: ffi::GDateMonth) -> Self { - match value as i32 { + match value { 0 => DateMonth::BadMonth, 1 => DateMonth::January, 2 => DateMonth::February, @@ -147,7 +146,7 @@ impl ToGlib for DateWeekday { DateWeekday::Friday => ffi::G_DATE_FRIDAY, DateWeekday::Saturday => ffi::G_DATE_SATURDAY, DateWeekday::Sunday => ffi::G_DATE_SUNDAY, - DateWeekday::__Unknown(value) => unsafe{std::mem::transmute(value)} + DateWeekday::__Unknown(value) => value } } } @@ -155,7 +154,7 @@ impl ToGlib for DateWeekday { #[doc(hidden)] impl FromGlib for DateWeekday { fn from_glib(value: ffi::GDateWeekday) -> Self { - match value as i32 { + match value { 0 => DateWeekday::BadWeekday, 1 => DateWeekday::Monday, 2 => DateWeekday::Tuesday, @@ -193,7 +192,7 @@ impl ToGlib for KeyFileError { KeyFileError::KeyNotFound => ffi::G_KEY_FILE_ERROR_KEY_NOT_FOUND, KeyFileError::GroupNotFound => ffi::G_KEY_FILE_ERROR_GROUP_NOT_FOUND, KeyFileError::InvalidValue => ffi::G_KEY_FILE_ERROR_INVALID_VALUE, - KeyFileError::__Unknown(value) => unsafe{std::mem::transmute(value)} + KeyFileError::__Unknown(value) => value } } } @@ -201,7 +200,7 @@ impl ToGlib for KeyFileError { #[doc(hidden)] impl FromGlib for KeyFileError { fn from_glib(value: ffi::GKeyFileError) -> Self { - match value as i32 { + match value { 0 => KeyFileError::UnknownEncoding, 1 => KeyFileError::Parse, 2 => KeyFileError::NotFound, @@ -219,7 +218,7 @@ impl ErrorDomain for KeyFileError { } fn code(self) -> i32 { - self.to_glib() as i32 + self.to_glib() } fn from(code: i32) -> Option { @@ -253,7 +252,7 @@ impl ToGlib for TimeType { TimeType::Standard => ffi::G_TIME_TYPE_STANDARD, TimeType::Daylight => ffi::G_TIME_TYPE_DAYLIGHT, TimeType::Universal => ffi::G_TIME_TYPE_UNIVERSAL, - TimeType::__Unknown(value) => unsafe{std::mem::transmute(value)} + TimeType::__Unknown(value) => value } } } @@ -261,7 +260,7 @@ impl ToGlib for TimeType { #[doc(hidden)] impl FromGlib for TimeType { fn from_glib(value: ffi::GTimeType) -> Self { - match value as i32 { + match value { 0 => TimeType::Standard, 1 => TimeType::Daylight, 2 => TimeType::Universal, diff --git a/src/auto/flags.rs b/src/auto/flags.rs index 91911769..60ca21ef 100644 --- a/src/auto/flags.rs +++ b/src/auto/flags.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (0fe730d) from gir-files (db49619) +// This file was generated by gir (94e079d) from gir-files (469db10) // DO NOT EDIT use ffi; diff --git a/src/auto/functions.rs b/src/auto/functions.rs index e122ba9a..0cab40dd 100644 --- a/src/auto/functions.rs +++ b/src/auto/functions.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (0fe730d) from gir-files (db49619) +// This file was generated by gir (94e079d) from gir-files (469db10) // DO NOT EDIT #[cfg(any(feature = "v2_34", feature = "dox"))] diff --git a/src/auto/key_file.rs b/src/auto/key_file.rs index 69d3f869..91dc20d9 100644 --- a/src/auto/key_file.rs +++ b/src/auto/key_file.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (0fe730d) from gir-files (db49619) +// This file was generated by gir (94e079d) from gir-files (469db10) // DO NOT EDIT #[cfg(any(feature = "v2_50", feature = "dox"))] diff --git a/src/auto/main_context.rs b/src/auto/main_context.rs index a9486eba..6df558cc 100644 --- a/src/auto/main_context.rs +++ b/src/auto/main_context.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (0fe730d) from gir-files (db49619) +// This file was generated by gir (94e079d) from gir-files (469db10) // DO NOT EDIT use ffi; diff --git a/src/auto/main_loop.rs b/src/auto/main_loop.rs index db46f803..1e5871a7 100644 --- a/src/auto/main_loop.rs +++ b/src/auto/main_loop.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (0fe730d) from gir-files (db49619) +// This file was generated by gir (94e079d) from gir-files (469db10) // DO NOT EDIT use MainContext; diff --git a/src/auto/mod.rs b/src/auto/mod.rs index 36b3aff1..76129896 100644 --- a/src/auto/mod.rs +++ b/src/auto/mod.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (0fe730d) from gir-files (db49619) +// This file was generated by gir (94e079d) from gir-files (469db10) // DO NOT EDIT mod checksum; diff --git a/src/auto/source.rs b/src/auto/source.rs index 0be4c10e..a336a185 100644 --- a/src/auto/source.rs +++ b/src/auto/source.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (0fe730d) from gir-files (db49619) +// This file was generated by gir (94e079d) from gir-files (469db10) // DO NOT EDIT use MainContext; diff --git a/src/auto/time_zone.rs b/src/auto/time_zone.rs index 5f8fff43..7612b24c 100644 --- a/src/auto/time_zone.rs +++ b/src/auto/time_zone.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (0fe730d) from gir-files (db49619) +// This file was generated by gir (94e079d) from gir-files (469db10) // DO NOT EDIT use TimeType; diff --git a/src/variant.rs b/src/variant.rs index 0ebac334..894aaa3b 100644 --- a/src/variant.rs +++ b/src/variant.rs @@ -261,7 +261,7 @@ impl StaticVariantType for str { } impl ToVariant for str { - #[cfg(feature = "v2_38")] + #[cfg(any(feature = "v2_38"))] fn to_variant(&self) -> Variant { unsafe { from_glib_none(glib_ffi::g_variant_new_take_string(self.to_glib_full())) } }