Skip to content

Commit

Permalink
cleanup remaining clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Grokmoo committed Aug 13, 2021
1 parent d208b46 commit 901896a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 19 deletions.
6 changes: 3 additions & 3 deletions sulis_editor/src/actor_creator_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl ActorCreatorWindow {
fn build_preview(&mut self) {
let mut images = Vec::new();
for layer in ImageLayer::iter() {
let image = match self.selected_images.get(&layer) {
let image = match self.selected_images.get(layer) {
None => continue,
Some((_, ref image)) => Rc::clone(image),
};
Expand Down Expand Up @@ -312,12 +312,12 @@ impl WidgetKind for ActorCreatorWindow {

type ListBoxCb = list_box::Entry<Rc<Race>>;

let window_ref = Rc::clone(&widget);
let window_ref = Rc::clone(widget);
let cb: Rc<dyn Fn(Option<&ListBoxCb>)> = Rc::new(move |active_entry| {
let window = Widget::kind_mut::<ActorCreatorWindow>(&window_ref);
match active_entry {
None => window.selected_race = None,
Some(ref entry) => window.selected_race = Some(Rc::clone(entry.item())),
Some(entry) => window.selected_race = Some(Rc::clone(entry.item())),
}
window_ref.borrow_mut().invalidate_children();
});
Expand Down
2 changes: 1 addition & 1 deletion sulis_editor/src/elev_picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl EditorMode for ElevPicker {
w: 1.0,
h: 1.0,
};
draw_list.append(&mut DrawList::from_sprite_f32(&sprite, rect));
draw_list.append(&mut DrawList::from_sprite_f32(sprite, rect));
}
}
draw_list.set_scale(scale);
Expand Down
2 changes: 1 addition & 1 deletion sulis_editor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl WidgetKind for EditorView {
"exit_confirmation_window",
);
exit_window.borrow_mut().state.set_modal(true);
Widget::add_child_to(&widget, exit_window);
Widget::add_child_to(widget, exit_window);
}
_ => return false,
}
Expand Down
6 changes: 3 additions & 3 deletions sulis_editor/src/save_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl WidgetKind for SaveWindow {
{
Widget::add_child_to(&id_box, Widget::with_defaults(Label::empty()));
let field =
Widget::with_defaults(InputField::new(&self.area_editor.borrow().model.id()));
Widget::with_defaults(InputField::new(self.area_editor.borrow().model.id()));

let area_editor_ref = Rc::clone(&self.area_editor);
field
Expand All @@ -103,7 +103,7 @@ impl WidgetKind for SaveWindow {
{
Widget::add_child_to(&name_box, Widget::with_defaults(Label::empty()));
let field =
Widget::with_defaults(InputField::new(&self.area_editor.borrow().model.name()));
Widget::with_defaults(InputField::new(self.area_editor.borrow().model.name()));

let area_editor_ref = Rc::clone(&self.area_editor);
field
Expand All @@ -127,7 +127,7 @@ impl WidgetKind for SaveWindow {
{
Widget::add_child_to(&filename_box, Widget::with_defaults(Label::empty()));
let field =
Widget::with_defaults(InputField::new(&self.area_editor.borrow().model.filename()));
Widget::with_defaults(InputField::new(self.area_editor.borrow().model.filename()));

let area_editor_ref = Rc::clone(&self.area_editor);
field
Expand Down
2 changes: 1 addition & 1 deletion sulis_editor/src/transition_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ impl WidgetKind for TransitionWindow {
}

let mut entries: Vec<list_box::Entry<String>> = Vec::new();
for (index, ref transition) in self
for (index, transition) in self
.area_editor
.borrow()
.model
Expand Down
11 changes: 1 addition & 10 deletions sulis_view/src/main_menu/mods_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

use std::any::Any;
use std::cell::RefCell;
use std::path::PathBuf;
use std::rc::Rc;

use sulis_core::ui::*;
Expand All @@ -39,16 +38,8 @@ impl ModsSelector {
let mut active_mods = Vec::new();

let active_resources = ActiveResources::read();
let active: Vec<_> = active_resources
.mods
.iter()
.map(|path| PathBuf::from(&path))
.collect();

for modif in mods {
let mod_path = PathBuf::from(&modif.dir);

if active.contains(&mod_path) {
if active_resources.mods.iter().any(|path| path == &modif.dir) {
active_mods.push(modif);
} else {
available_mods.push(modif);
Expand Down

0 comments on commit 901896a

Please sign in to comment.