diff --git a/citadel-realms/src/dialogs.rs b/citadel-realms/src/dialogs.rs index d2609af..d9e4327 100644 --- a/citadel-realms/src/dialogs.rs +++ b/citadel-realms/src/dialogs.rs @@ -179,7 +179,7 @@ impl FieldDialogBuilder { } pub fn set_height(&mut self, height: usize) { - self.height = Some(height);; + self.height = Some(height); } pub fn height(mut self, height: usize) -> Self { @@ -432,7 +432,7 @@ impl ValidatorResult { #[derive(Clone)] pub struct TextValidator { id: String, - is_valid: Rc ValidatorResult>>, + is_valid: Rc ValidatorResult>>, } impl TextValidator { diff --git a/citadel-realms/src/item_list.rs b/citadel-realms/src/item_list.rs index 9d25b3f..e84f743 100644 --- a/citadel-realms/src/item_list.rs +++ b/citadel-realms/src/item_list.rs @@ -117,7 +117,7 @@ pub struct ItemList { selector: Selector, last_size: Vec2, info_state: Rc, - content: Box>, + content: Box>, } impl ItemList { diff --git a/citadel-realms/src/logview.rs b/citadel-realms/src/logview.rs index 982a913..a2e24a9 100644 --- a/citadel-realms/src/logview.rs +++ b/citadel-realms/src/logview.rs @@ -59,7 +59,7 @@ impl LogView { } impl ViewWrapper for LogView { - type V = View; + type V = dyn View; fn with_view(&self, f: F) -> Option where F: FnOnce(&Self::V) -> R diff --git a/citadel-realms/src/notes.rs b/citadel-realms/src/notes.rs index 29e075a..304d99a 100644 --- a/citadel-realms/src/notes.rs +++ b/citadel-realms/src/notes.rs @@ -8,7 +8,7 @@ use std::rc::Rc; pub struct NotesDialog { inner: ViewBox, - callback: Rc, + callback: Rc, } impl NotesDialog { @@ -62,7 +62,7 @@ impl NotesDialog { } impl ViewWrapper for NotesDialog { - type V = View; + type V = dyn View; fn with_view(&self, f: F) -> Option where F: FnOnce(&Self::V) -> R diff --git a/citadel-realms/src/realm/actions.rs b/citadel-realms/src/realm/actions.rs index 07a408a..71c215e 100644 --- a/citadel-realms/src/realm/actions.rs +++ b/citadel-realms/src/realm/actions.rs @@ -14,12 +14,12 @@ use crate::notes::NotesDialog; use cursive::views::Dialog; use crate::realmfs::RealmFSAction; -type ActionCallback = Fn(&Realm)+Send+Sync; +type ActionCallback = dyn Fn(&Realm)+Send+Sync; #[derive(Clone)] pub struct RealmAction { realm: Realm, - sink: Sender>, + sink: Sender>, callback: Arc } diff --git a/citadel-realms/src/realm/config_realm.rs b/citadel-realms/src/realm/config_realm.rs index a90c100..e4a3a61 100644 --- a/citadel-realms/src/realm/config_realm.rs +++ b/citadel-realms/src/realm/config_realm.rs @@ -315,7 +315,7 @@ impl DialogButtonAdapter for ConfigDialog { } impl ViewWrapper for ConfigDialog { - type V = View; + type V = dyn View; fn with_view(&self, f: F) -> Option where F: FnOnce(&Self::V) -> R @@ -412,7 +412,7 @@ struct RealmOptions { } -type Accessor = 'static + (Fn(&mut RealmConfig) -> &mut Option); +type Accessor = dyn 'static + (Fn(&mut RealmConfig) -> &mut Option); impl RealmOptions { diff --git a/citadel-realms/src/realm/delete_realm.rs b/citadel-realms/src/realm/delete_realm.rs index 4f1eb94..f30791e 100644 --- a/citadel-realms/src/realm/delete_realm.rs +++ b/citadel-realms/src/realm/delete_realm.rs @@ -88,7 +88,7 @@ impl DialogButtonAdapter for DeleteRealmDialog { } impl ViewWrapper for DeleteRealmDialog { - type V = View; + type V = dyn View; fn with_view(&self, f: F) -> Option where F: FnOnce(&Self::V) -> R diff --git a/citadel-realms/src/realm/new_realm.rs b/citadel-realms/src/realm/new_realm.rs index a6e3ace..9ed137f 100644 --- a/citadel-realms/src/realm/new_realm.rs +++ b/citadel-realms/src/realm/new_realm.rs @@ -216,7 +216,7 @@ impl DialogButtonAdapter for NewRealmDialog { } impl ViewWrapper for NewRealmDialog { - type V = View; + type V = dyn View; fn with_view(&self, f: F) -> Option where F: FnOnce(&Self::V) -> R @@ -392,7 +392,7 @@ impl NewRealmFSDialog { impl ViewWrapper for NewRealmFSDialog { - type V = View; + type V = dyn View; fn with_view(&self, f: F) -> Option where F: FnOnce(&Self::V) -> R diff --git a/citadel-realms/src/realmfs/fork_dialog.rs b/citadel-realms/src/realmfs/fork_dialog.rs index 3a8a7e9..7a2614d 100644 --- a/citadel-realms/src/realmfs/fork_dialog.rs +++ b/citadel-realms/src/realmfs/fork_dialog.rs @@ -118,7 +118,7 @@ impl ForkDialog { } impl ViewWrapper for ForkDialog { - type V = View; + type V = dyn View; fn with_view(&self, f: F) -> Option where F: FnOnce(&Self::V) -> R diff --git a/citadel-realms/src/theme.rs b/citadel-realms/src/theme.rs index 9844609..51c7392 100644 --- a/citadel-realms/src/theme.rs +++ b/citadel-realms/src/theme.rs @@ -247,7 +247,7 @@ impl ThemeChooser { } impl ViewWrapper for ThemeChooser { - type V = View; + type V = dyn View; fn with_view R, R>(&self, f: F) -> Option { Some(f(&*self.inner)) } fn with_view_mut R, R>(&mut self, f: F) -> Option { Some(f(&mut *self.inner)) } diff --git a/citadel-realms/src/tree/mod.rs b/citadel-realms/src/tree/mod.rs index d1b78b2..f23882b 100644 --- a/citadel-realms/src/tree/mod.rs +++ b/citadel-realms/src/tree/mod.rs @@ -35,10 +35,10 @@ use cursive::rect::Rect; //use cursive::rect::Rect; /// Callback taking an item index as input. -type IndexCallback = Rc; +type IndexCallback = Rc; /// Callback taking as input the row ID, the collapsed state, and the child ID. -type CollapseCallback = Rc; +type CollapseCallback = Rc; /// A low level tree view. /// diff --git a/citadel-tool/src/update/kernel.rs b/citadel-tool/src/update/kernel.rs index d73c7d6..1c4d212 100644 --- a/citadel-tool/src/update/kernel.rs +++ b/citadel-tool/src/update/kernel.rs @@ -395,7 +395,7 @@ impl BootEntry { // Increment index value and rename boot entry file. Return false // if new name already exists. - fn rotate(&mut self) -> Result<(bool)> { + fn rotate(&mut self) -> Result { let old_path = self.path(); let old_index = self.index; self.index = match self.index { diff --git a/libcitadel/src/keyring.rs b/libcitadel/src/keyring.rs index c8ac1c6..11af1df 100644 --- a/libcitadel/src/keyring.rs +++ b/libcitadel/src/keyring.rs @@ -5,7 +5,7 @@ use std::fs; use std::ffi::CString; use std::os::raw::c_char; -use libc::{self,c_long,c_ulong, c_int, int32_t}; +use libc::{self,c_long,c_ulong, c_int}; use hex; use sodiumoxide::randombytes::randombytes_into; @@ -176,7 +176,7 @@ const KEYCTL_READ : c_int = 11; // read a key or keyring's conte const KEY_SPEC_USER_KEYRING : c_int = -4; // - key ID for UID-specific keyring -pub struct KernelKey(int32_t); +pub struct KernelKey(i32); impl KernelKey { diff --git a/libcitadel/src/log.rs b/libcitadel/src/log.rs index d800742..9bba84b 100644 --- a/libcitadel/src/log.rs +++ b/libcitadel/src/log.rs @@ -53,7 +53,7 @@ pub trait LogOutput: Send { pub struct Logger { level: LogLevel, - output: Box, + output: Box, } impl Logger { @@ -62,7 +62,7 @@ impl Logger { logger.level = level; } - pub fn set_log_output(output: Box) { + pub fn set_log_output(output: Box) { let mut logger = LOGGER.lock().unwrap(); logger.output = output; } diff --git a/libcitadel/src/realm/events.rs b/libcitadel/src/realm/events.rs index 28371da..62e2f8f 100644 --- a/libcitadel/src/realm/events.rs +++ b/libcitadel/src/realm/events.rs @@ -32,7 +32,7 @@ impl Display for RealmEvent { } } -pub type RealmEventHandler = Fn(&RealmEvent)+Send+Sync; +pub type RealmEventHandler = dyn Fn(&RealmEvent)+Send+Sync; pub struct RealmEventListener { inner: Arc>, diff --git a/libcitadel/src/system/uname.rs b/libcitadel/src/system/uname.rs index 326c726..5175d7c 100644 --- a/libcitadel/src/system/uname.rs +++ b/libcitadel/src/system/uname.rs @@ -12,7 +12,7 @@ pub struct UtsName(libc::utsname); impl UtsName { pub fn uname() -> UtsName { unsafe { - let mut ret: UtsName = mem::uninitialized(); + let mut ret: UtsName = mem::zeroed(); libc::uname(&mut ret.0); ret }