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

Commit

Permalink
Run everything through rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege committed Jun 12, 2019
1 parent 5a3e205 commit 05f068b
Show file tree
Hide file tree
Showing 45 changed files with 3,222 additions and 1,653 deletions.
10 changes: 3 additions & 7 deletions src/auto/checksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use ChecksumType;
use glib_sys;
use translate::*;
use ChecksumType;

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

impl Checksum {
pub fn new(checksum_type: ChecksumType) -> Checksum {
unsafe {
from_glib_full(glib_sys::g_checksum_new(checksum_type.to_glib()))
}
unsafe { from_glib_full(glib_sys::g_checksum_new(checksum_type.to_glib())) }
}

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

pub fn type_get_length(checksum_type: ChecksumType) -> isize {
unsafe {
glib_sys::g_checksum_type_get_length(checksum_type.to_glib())
}
unsafe { glib_sys::g_checksum_type_get_length(checksum_type.to_glib()) }
}
}

Expand Down
204 changes: 168 additions & 36 deletions src/auto/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,110 +6,242 @@ use glib_sys;
use std::ffi::CStr;

lazy_static! {
pub static ref CSET_A_2_Z: &'static str = unsafe{CStr::from_ptr(glib_sys::G_CSET_A_2_Z).to_str().unwrap()};
pub static ref CSET_A_2_Z: &'static str =
unsafe { CStr::from_ptr(glib_sys::G_CSET_A_2_Z).to_str().unwrap() };
}
lazy_static! {
pub static ref CSET_DIGITS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_CSET_DIGITS).to_str().unwrap()};
pub static ref CSET_DIGITS: &'static str =
unsafe { CStr::from_ptr(glib_sys::G_CSET_DIGITS).to_str().unwrap() };
}
lazy_static! {
pub static ref CSET_a_2_z: &'static str = unsafe{CStr::from_ptr(glib_sys::G_CSET_a_2_z).to_str().unwrap()};
pub static ref CSET_a_2_z: &'static str =
unsafe { CStr::from_ptr(glib_sys::G_CSET_a_2_z).to_str().unwrap() };
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_GROUP: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_GROUP).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_GROUP: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_GROUP)
.to_str()
.unwrap()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
pub static ref OPTION_REMAINING: &'static str = unsafe{CStr::from_ptr(glib_sys::G_OPTION_REMAINING).to_str().unwrap()};
pub static ref OPTION_REMAINING: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_OPTION_REMAINING)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref STR_DELIMITERS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_STR_DELIMITERS).to_str().unwrap()};
pub static ref STR_DELIMITERS: &'static str =
unsafe { CStr::from_ptr(glib_sys::G_STR_DELIMITERS).to_str().unwrap() };
}
lazy_static! {
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()};
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()
};
}
lazy_static! {
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()};
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()
};
}

0 comments on commit 05f068b

Please sign in to comment.