maraiah: clippy
parent
2095e9d58a
commit
430457e570
|
@ -38,7 +38,7 @@ impl<T> std::ops::DerefMut for SeekBackToStart<T>
|
|||
impl<T> SeekBackToStart<T>
|
||||
where T: Seek
|
||||
{
|
||||
pub fn new(sc: T) -> Self {SeekBackToStart{sc, fl: true}}
|
||||
pub fn new(sc: T) -> Self {Self{sc, fl: true}}
|
||||
|
||||
pub fn set_seek(&mut self, fl: bool) {self.fl = fl;}
|
||||
pub fn get_seek(&self) -> bool {self.fl}
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
//! handling, FFI tools, fixed point numbers, and image and sound structures.
|
||||
//!
|
||||
//! Maraiah also comes with APIs for working with various data formats,
|
||||
//! primarily Marathon's. It also handles Macintosh PICT files, Portable PixMap,
|
||||
//! TARGA, RIFF WAVE, and more.
|
||||
//! primarily Marathon's. It also handles Macintosh PICT files, PPM, TARGA, RIFF
|
||||
//! WAVE, and more.
|
||||
//!
|
||||
//! # Features
|
||||
//!
|
||||
|
|
|
@ -67,13 +67,13 @@ pub fn read(head: &head::Header, b: &[u8]) -> ResultS<EntryData>
|
|||
pub fn read_all(head: &head::Header,
|
||||
map: &entr::EntryMap<'_>) -> ResultS<EntryDataMap>
|
||||
{
|
||||
let mut dmap = EntryDataMap::new();
|
||||
let mut data_map = EntryDataMap::new();
|
||||
|
||||
for (&index, entry) in map {
|
||||
dmap.insert(index, read(head, &entry.data)?);
|
||||
data_map.insert(index, read(head, entry.data)?);
|
||||
}
|
||||
|
||||
Ok(dmap)
|
||||
Ok(data_map)
|
||||
}
|
||||
|
||||
/// The loaded data of a Map file entry.
|
||||
|
|
|
@ -49,8 +49,8 @@ impl Header
|
|||
ver_wad: Ver,
|
||||
name: Option<String>) -> Self
|
||||
{
|
||||
let name = name.unwrap_or(String::new());
|
||||
Header{name, size_appl, ver_data, ver_wad}
|
||||
let name = name.unwrap_or_default();
|
||||
Self{name, size_appl, ver_data, ver_wad}
|
||||
}
|
||||
|
||||
/// Returns `true` if the data is in Marathon 1 format.
|
||||
|
|
Loading…
Reference in New Issue