made clippy happy
This commit is contained in:
+1
-1
@@ -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;
|
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
|
/// Essentially the same as the `stars` function but instead of
|
||||||
|
|||||||
+7
-4
@@ -123,15 +123,18 @@ impl Beatmap {
|
|||||||
|
|
||||||
reader.read_line(&mut buf)?;
|
reader.read_line(&mut buf)?;
|
||||||
|
|
||||||
let mut map = Self::default();
|
let version = match buf.find(OSU_FILE_HEADER) {
|
||||||
|
|
||||||
map.version = match buf.find(OSU_FILE_HEADER) {
|
|
||||||
Some(idx) => buf[idx + OSU_FILE_HEADER.len()..].trim_end().parse()?,
|
Some(idx) => buf[idx + OSU_FILE_HEADER.len()..].trim_end().parse()?,
|
||||||
None => return Err(ParseError::IncorrectFileHeader),
|
None => return Err(ParseError::IncorrectFileHeader),
|
||||||
};
|
};
|
||||||
|
|
||||||
buf.clear();
|
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;
|
let mut section = Section::None;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user