Make clippy happy

This commit is contained in:
Joshua Barretto 2023-04-01 22:55:45 +01:00
parent 2e6d55a78b
commit 33ebb0a4a3
2 changed files with 7 additions and 11 deletions

View File

@ -885,7 +885,7 @@ fn handle_respawn(
.state .state
.read_storage::<comp::Waypoint>() .read_storage::<comp::Waypoint>()
.get(target) .get(target)
.ok_or_else(|| "No waypoint set")? .ok_or("No waypoint set")?
.get_pos(); .get_pos();
position_mut(server, target, "target", |current_pos| { position_mut(server, target, "target", |current_pos| {

View File

@ -1332,13 +1332,12 @@ impl Controls {
let map_img = Image::new(self.map_img) let map_img = Image::new(self.map_img)
.height(Length::Units(map_sz.x)) .height(Length::Units(map_sz.x))
.width(Length::Units(map_sz.y)); .width(Length::Units(map_sz.y));
let site_name = Text::new(format!( let site_name = Text::new(
"{}",
self.possible_starting_sites[*start_site_idx] self.possible_starting_sites[*start_site_idx]
.name .name
.as_deref() .as_deref()
.unwrap_or("Unknown") .unwrap_or("Unknown"),
)) )
.horizontal_alignment(HorizontalAlignment::Left); .horizontal_alignment(HorizontalAlignment::Left);
let map = if let Some(info) = self.possible_starting_sites.get(*start_site_idx) let map = if let Some(info) = self.possible_starting_sites.get(*start_site_idx)
@ -1357,8 +1356,7 @@ impl Controls {
.spacing(2) .spacing(2)
.push(site_name) .push(site_name)
.push(marker_img) .push(marker_img)
.align_items(Align::Center) .align_items(Align::Center);
.into();
Overlay::new( Overlay::new(
Container::new(marker_content) Container::new(marker_content)
@ -1385,8 +1383,7 @@ impl Controls {
FILL_FRAC_ONE, FILL_FRAC_ONE,
button_style, button_style,
Some(Message::PrevStartingSite), Some(Message::PrevStartingSite),
) ),
.into(),
neat_button( neat_button(
next_starting_site_button, next_starting_site_button,
i18n.get_msg("char_selection-starting_site_next") i18n.get_msg("char_selection-starting_site_next")
@ -1394,8 +1391,7 @@ impl Controls {
FILL_FRAC_ONE, FILL_FRAC_ONE,
button_style, button_style,
Some(Message::NextStartingSite), Some(Message::NextStartingSite),
) ),
.into(),
]) ])
.max_height(60) .max_height(60)
.padding(15) .padding(15)