chore: apply some lints

This commit is contained in:
poly000 2024-03-24 22:40:33 +08:00
parent 2bc138e796
commit 4e69e2af04
No known key found for this signature in database
2 changed files with 4 additions and 9 deletions

View File

@ -1,6 +1,6 @@
use std::collections::HashMap;
use std::io;
use std::io::{BufRead, BufReader, Cursor, Read};
use std::io::{BufRead, BufReader, Read};
use std::sync::Arc;
use byteorder::{ReadBytesExt, LE};
@ -83,7 +83,7 @@ impl Map {
}
fn read_string<R: io::Read>(map_data: &mut R) -> GameResult<String> {
let mut bytes = map_data.read_u8()? as u32;
let bytes = map_data.read_u8()? as u32;
let mut raw_chars = Vec::new();
raw_chars.resize(bytes as usize, 0u8);
map_data.read(&mut raw_chars)?;

View File

@ -1,5 +1,4 @@
use std::collections::HashMap;
use std::string;
use crate::framework::context::Context;
use crate::framework::filesystem;
@ -20,11 +19,7 @@ impl Default for Locale {
Locale {
code: "en".to_owned(),
name: "English".to_owned(),
font: FontData {
path: String::new(),
scale: 1.0,
space_offset: 0.0
},
font: FontData { path: String::new(), scale: 1.0, space_offset: 0.0 },
encoding: None,
stage_encoding: None,
strings: HashMap::new(),
@ -44,7 +39,7 @@ impl Locale {
let font_name = strings["font"].clone();
let font_scale = strings["font_scale"].parse::<f32>().unwrap_or(1.0);
let font = FontData::new(font_name, font_scale, 0.0);
let encoding = strings.get("encoding").cloned();
let stage_encoding = strings.get("stage_encoding").cloned();