made clippy happy

This commit is contained in:
MaxOhn
2021-01-20 19:57:37 +01:00
parent b2f2333c66
commit 318f677373
2 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
let stars = strain.difficulty_value() * STAR_SCALING_FACTOR;
return StarResult::Mania(DifficultyAttributes { stars });
StarResult::Mania(DifficultyAttributes { stars })
}
/// Essentially the same as the `stars` function but instead of
+7 -4
View File
@@ -123,15 +123,18 @@ impl Beatmap {
reader.read_line(&mut buf)?;
let mut map = Self::default();
map.version = match buf.find(OSU_FILE_HEADER) {
let version = match buf.find(OSU_FILE_HEADER) {
Some(idx) => buf[idx + OSU_FILE_HEADER.len()..].trim_end().parse()?,
None => return Err(ParseError::IncorrectFileHeader),
};
buf.clear();
map.hit_objects.reserve(256);
let mut map = Beatmap {
version,
hit_objects: Vec::with_capacity(256),
..Default::default()
};
let mut section = Section::None;