unused vars cleanup

This commit is contained in:
Llywelwyn 2023-08-27 18:08:29 +01:00
parent 537e19c4e7
commit 96e69d5c5e
6 changed files with 9 additions and 11 deletions

View file

@ -83,5 +83,3 @@ pub const TO_OVERMAP_GLYPH: char = '<';
pub const TO_OVERMAP_COLOUR: (u8, u8, u8) = (205, 127, 50);
pub const TO_TOWN_GLYPH: char = 'o';
pub const TO_TOWN_COLOUR: (u8, u8, u8) = (205, 127, 50);
pub const TO_INFINITE_GLYPH: char = '*';
pub const TO_INFINITE_COLOUR: (u8, u8, u8) = (205, 127, 50);

View file

@ -112,7 +112,7 @@ pub fn identify(gs: &mut State, ctx: &mut Rltk) -> (ItemMenuResult, Option<Entit
};
player_inventory
.entry(unique_item)
.and_modify(|(e, count)| {
.and_modify(|(_e, count)| {
*count += 1;
})
.or_insert((entity, 1));

View file

@ -463,7 +463,7 @@ pub fn print_options(inventory: &PlayerInventory, mut x: i32, mut y: i32, ctx: &
pub fn get_max_inventory_width(inventory: &PlayerInventory) -> i32 {
let mut width: i32 = 0;
for (item, (e, count)) in inventory {
for (item, (_e, count)) in inventory {
let mut this_width = item.display_name.singular.len() as i32;
// Clean this up. It should use consts.
this_width += 4; // The spaces before and after the character to select this item, etc.
@ -749,7 +749,7 @@ pub fn get_player_inventory(ecs: &World) -> PlayerInventory {
};
player_inventory
.entry(unique_item)
.and_modify(|(e, count)| {
.and_modify(|(_e, count)| {
*count += 1;
})
.or_insert((entity, 1));

View file

@ -95,7 +95,7 @@ pub fn remove_curse(gs: &mut State, ctx: &mut Rltk) -> (ItemMenuResult, Option<E
};
player_inventory
.entry(unique_item)
.and_modify(|(e, count)| {
.and_modify(|(_e, count)| {
*count += 1;
})
.or_insert((entity, 1));

View file

@ -5,7 +5,6 @@ use serde::{ Deserialize, Serialize };
use specs::prelude::*;
use std::collections::{ HashMap, HashSet };
use crate::data::events::*;
use crate::data::ids::*;
#[derive(Default, Serialize, Deserialize, Clone)]
pub struct MasterDungeonMap {

View file

@ -116,7 +116,7 @@ fn get_forest_theme_renderables(idx:usize, map: &Map, debug: Option<bool>) -> (r
TileType::Wall => { glyph = rltk::to_cp437(FOREST_WALL_GLYPH); fg = RGB::named(FOREST_WALL_COLOUR); bg = RGB::named(GRASS_COLOUR); offsets = GRASS_OFFSETS; }
TileType::Road => { glyph = rltk::to_cp437(ROAD_GLYPH); bg = RGB::named(ROAD_COLOUR); }
TileType::ShallowWater => { glyph = rltk::to_cp437(SHALLOW_WATER_GLYPH); bg = RGB::named(SHALLOW_WATER_COLOUR); offsets = SHALLOW_WATER_OFFSETS; }
_ => { (glyph, fg, _, (offsets, bg_offsets)) = get_default_theme_renderables(idx, map, debug); bg = RGB::named(GRASS_COLOUR); bg_offsets = GRASS_OFFSETS; }
_ => { (glyph, fg, _, (offsets, _)) = get_default_theme_renderables(idx, map, debug); bg = RGB::named(GRASS_COLOUR); bg_offsets = GRASS_OFFSETS; }
}
if bg_offsets == (-1, -1, -1) {
bg_offsets = offsets;
@ -319,10 +319,11 @@ fn darken_by_distance(pos: Point, other_pos: Point) -> f32 {
(distance - START_DARKEN_AT_N_TILES) /
((crate::data::entity::DEFAULT_VIEWSHED_STANDARD as f32) - START_DARKEN_AT_N_TILES);
let interp_factor = interp_factor.max(0.0).min(1.0); // Clamp [0-1]
return (
let result =
1.0 -
interp_factor * (1.0 - (if CONFIG.visuals.with_scanlines { MAX_DARKENING_IF_SCANLINES } else { MAX_DARKENING }))
);
interp_factor *
(1.0 - (if CONFIG.visuals.with_scanlines { MAX_DARKENING_IF_SCANLINES } else { MAX_DARKENING }));
return result;
}
fn brighten_by(mut fg: RGB, mut bg: RGB, amount: f32) -> (RGB, RGB) {