Fix compilation warnings

This commit is contained in:
daa84 2017-03-14 10:48:04 +03:00
parent 7915541a7d
commit b68d2470c3

View File

@ -10,6 +10,7 @@ use gio;
#[derive(PartialEq)] #[derive(PartialEq)]
pub enum FontSource { pub enum FontSource {
Rpc, Rpc,
#[cfg(unix)]
Gnome, Gnome,
Default, Default,
} }
@ -23,7 +24,6 @@ pub struct Settings {
} }
impl Settings { impl Settings {
#[cfg(unix)] #[cfg(unix)]
pub fn new() -> Settings { pub fn new() -> Settings {
Settings { Settings {
@ -34,9 +34,7 @@ impl Settings {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
pub fn new() -> Settings { pub fn new() -> Settings {
Settings { Settings { font_source: FontSource::Default }
font_source: FontSource::Default,
}
} }
#[cfg(unix)] #[cfg(unix)]
@ -46,13 +44,7 @@ impl Settings {
} }
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
pub fn init(&mut self, ui: &mut Ui) { pub fn init(&mut self, _: &mut Ui) {}
}
#[cfg(target_os = "windows")]
fn update_font(&mut self, ui: &mut Ui) {
}
#[cfg(unix)] #[cfg(unix)]
fn update_font(&mut self, ui: &mut Ui) { fn update_font(&mut self, ui: &mut Ui) {
@ -61,7 +53,8 @@ impl Settings {
return; return;
} }
if let Some(ref font_name) = self.gnome_interface_settings.get_string("monospace-font-name") { if let Some(ref font_name) = self.gnome_interface_settings
.get_string("monospace-font-name") {
ui.set_font_desc(font_name); ui.set_font_desc(font_name);
self.font_source = FontSource::Gnome; self.font_source = FontSource::Gnome;
} }
@ -87,4 +80,3 @@ fn monospace_font_changed() {
}); });
}); });
} }