Skip to content

feat: packfiledirectory #274

feat: packfiledirectory

feat: packfiledirectory #274

Triggered via pull request May 23, 2025 01:29
Status Success
Total duration 1m 17s
Artifacts

safety.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

25 warnings
unnecessary semicolon: ashen/src/utils/nom.rs#L119
warning: unnecessary semicolon --> ashen/src/utils/nom.rs:119:14 | 119 | }; | ^ help: remove | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon
this expression creates a reference which is immediately dereferenced by the compiler: ashen/src/utils/format.rs#L286
warning: this expression creates a reference which is immediately dereferenced by the compiler --> ashen/src/utils/format.rs:286:31 | 286 | .with_palette(&palette) | ^^^^^^^^ help: change this to: `palette` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this function has too many lines (149/100): ashen/src/utils/format.rs#L150
warning: this function has too many lines (149/100) --> ashen/src/utils/format.rs:150:5 | 150 | / fn to_py(&self, palette: &[Color]) -> String { 151 | | macro_rules! display_color { 152 | | ($c:expr) => { 153 | | format!( ... | 311 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
redundant closure: ashen/src/utils/format.rs#L138
warning: redundant closure --> ashen/src/utils/format.rs:138:46 | 138 | .chain(self.data.iter().flat_map(|s| s.wave_le_bytes())) | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `super::super::asset::sound::sample::AudioSamplePoint::wave_le_bytes` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls = note: `#[warn(clippy::redundant_closure_for_method_calls)]` implied by `#[warn(clippy::pedantic)]`
unnecessary semicolon: ashen/src/error.rs#L119
warning: unnecessary semicolon --> ashen/src/error.rs:119:6 | 119 | }; | ^ help: remove | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon = note: `#[warn(clippy::unnecessary_semicolon)]` implied by `#[warn(clippy::pedantic)]`
docs for function returning `Result` missing `# Errors` section: ashen/src/asset/texture/mod.rs#L100
warning: docs for function returning `Result` missing `# Errors` section --> ashen/src/asset/texture/mod.rs:100:5 | 100 | / pub fn to_gif<W>( 101 | | &self, 102 | | mut writer: W, 103 | | palette: &[super::color_map::Color; 256], 104 | | ) -> std::io::Result<()> 105 | | where 106 | | W: std::io::Write, | |__________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
deref on an immutable reference: ashen/src/asset/texture/mod.rs#L94
warning: deref on an immutable reference --> ashen/src/asset/texture/mod.rs:94:52 | 94 | writer.write_all(&self.colors.with_palette(&*palette).to_png()) | ^^^^^^^^^ help: if you would like to reborrow, try removing `&*`: `palette` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
docs for function returning `Result` missing `# Errors` section: ashen/src/asset/texture/mod.rs#L82
warning: docs for function returning `Result` missing `# Errors` section --> ashen/src/asset/texture/mod.rs:82:5 | 82 | / pub fn to_png<W>( 83 | | &self, 84 | | mut writer: W, 85 | | palette: &[super::color_map::Color; 256], 86 | | ) -> std::io::Result<()> 87 | | where 88 | | W: std::io::Write, | |__________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
docs for function returning `Result` missing `# Errors` section: ashen/src/asset/sound/mod.rs#L28
warning: docs for function returning `Result` missing `# Errors` section --> ashen/src/asset/sound/mod.rs:28:5 | 28 | / pub fn to_wave<W>(&self, mut writer: W) -> std::io::Result<()> 29 | | where 30 | | W: std::io::Write, | |__________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
this `map_or` can be simplified: ashen/src/asset/sound/dat/mixer.rs#L212
warning: this `map_or` can be simplified --> ashen/src/asset/sound/dat/mixer.rs:212:20 | 212 | || envelope | ____________________^ 213 | | .sustain 214 | | .map_or(true, |s| self.pos_volume_envelope < s)) | |___________________________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or = note: `#[warn(clippy::unnecessary_map_or)]` on by default help: use is_none_or instead | 214 - .map_or(true, |s| self.pos_volume_envelope < s)) 214 + .is_none_or(|s| self.pos_volume_envelope < s)) |
docs for function returning `Result` missing `# Errors` section: ashen/src/asset/skybox.rs#L38
warning: docs for function returning `Result` missing `# Errors` section --> ashen/src/asset/skybox.rs:38:5 | 38 | / pub fn to_png<W>(&self, mut writer: W) -> std::io::Result<()> 39 | | where 40 | | W: std::io::Write, | |__________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
docs for function returning `Result` missing `# Errors` section: ashen/src/asset/pack_file.rs#L28
warning: docs for function returning `Result` missing `# Errors` section --> ashen/src/asset/pack_file.rs:28:5 | 28 | pub fn new(input: &[u8]) -> Result<Self> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
this expression creates a reference which is immediately dereferenced by the compiler: ashen/src/asset/pack_file/directory.rs#L233
warning: this expression creates a reference which is immediately dereferenced by the compiler --> ashen/src/asset/pack_file/directory.rs:233:62 | 233 | .filter(|(f, _)| recursive || f.parent() == Some(&path)) | ^^^^^ help: change this to: `path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
the borrowed expression implements the required traits: ashen/src/asset/pack_file/directory.rs#L232
warning: the borrowed expression implements the required traits --> ashen/src/asset/pack_file/directory.rs:232:44 | 232 | .filter(|(f, _)| f.starts_with(&path)) | ^^^^^ help: change this to: `path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
docs for function returning `Result` missing `# Errors` section: ashen/src/asset/pack_file/directory.rs#L219
warning: docs for function returning `Result` missing `# Errors` section --> ashen/src/asset/pack_file/directory.rs:219:5 | 219 | / pub fn walk<P>(&self, path: P, recursive: bool) -> io::Result<Vec<(&Path, &FileHandle)>> 220 | | where 221 | | P: AsRef<Path>, | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
docs for function returning `Result` missing `# Errors` section: ashen/src/asset/pack_file/directory.rs#L210
warning: docs for function returning `Result` missing `# Errors` section --> ashen/src/asset/pack_file/directory.rs:210:5 | 210 | / pub fn read<P>(&self, path: P) -> io::Result<&FileHandle> 211 | | where 212 | | P: AsRef<Path>, | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
this function has too many lines (167/100): ashen/src/asset/pack_file/directory.rs#L27
warning: this function has too many lines (167/100) --> ashen/src/asset/pack_file/directory.rs:27:5 | 27 | / pub fn from_106_packfile(pack: PackFile) -> Option<Self> { 28 | | let mut files = BTreeMap::new(); 29 | | 30 | | let copyright = pack.copyright.into_bytes().into_boxed_slice(); ... | 207 | | Some(Self { files }) 208 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines = note: `#[warn(clippy::too_many_lines)]` implied by `#[warn(clippy::pedantic)]`
deref on an immutable reference: ashen/src/asset/model/mod.rs#L83
warning: deref on an immutable reference --> ashen/src/asset/model/mod.rs:83:42 | 83 | write!(writer, "{}", &self.to_py(&*palette)) | ^^^^^^^^^ help: if you would like to reborrow, try removing `&*`: `palette` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref = note: `#[warn(clippy::borrow_deref_ref)]` on by default
docs for function returning `Result` missing `# Errors` section: ashen/src/asset/model/mod.rs#L73
warning: docs for function returning `Result` missing `# Errors` section --> ashen/src/asset/model/mod.rs:73:5 | 73 | / pub fn to_blender_script<W>( 74 | | &self, 75 | | mut writer: W, 76 | | palette: &[crate::asset::color_map::Color; 256], 77 | | ) -> std::io::Result<()> 78 | | where 79 | | W: std::io::Write, | |__________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
unnecessary use of `to_vec`: ashen/src/asset/gamma_table.rs#L49
warning: unnecessary use of `to_vec` --> ashen/src/asset/gamma_table.rs:49:21 | 49 | let bytes = self | _____________________^ 50 | | .lookups 51 | | .to_vec() 52 | | .into_iter() | |________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned = note: `#[warn(clippy::unnecessary_to_owned)]` on by default help: use | 49 ~ let bytes = self 50 + .lookups.iter().copied() |
docs for function returning `Result` missing `# Errors` section: ashen/src/asset/gamma_table.rs#L44
warning: docs for function returning `Result` missing `# Errors` section --> ashen/src/asset/gamma_table.rs:44:5 | 44 | / pub fn to_png<W>(&self, mut writer: W) -> std::io::Result<()> 45 | | where 46 | | W: std::io::Write, | |__________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
`as` casting between raw pointers without changing their constness: ashen/src/asset/gamma_table.rs#L27
warning: `as` casting between raw pointers without changing their constness --> ashen/src/asset/gamma_table.rs:27:27 | 27 | let lookups = bytes.as_ptr() as *const [[_; ROWS_COUNT]; COLS_COUNT]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `bytes.as_ptr().cast::<[[_; ROWS_COUNT]; COLS_COUNT]>()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr = note: `#[warn(clippy::ptr_as_ptr)]` implied by `#[warn(clippy::pedantic)]`
docs for function returning `Result` missing `# Errors` section: ashen/src/asset/color_map.rs#L88
warning: docs for function returning `Result` missing `# Errors` section --> ashen/src/asset/color_map.rs:88:5 | 88 | / pub fn to_png<W>(&self, mut write: W) -> std::io::Result<()> 89 | | where 90 | | W: std::io::Write, | |__________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc = note: `#[warn(clippy::missing_errors_doc)]` implied by `#[warn(clippy::pedantic)]`
docs for function which may panic missing `# Panics` section: ashen/src/asset/color_map.rs#L16
warning: docs for function which may panic missing `# Panics` section --> ashen/src/asset/color_map.rs:16:5 | 16 | pub fn from_12_bit(color: u16) -> Self { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> ashen/src/asset/color_map.rs:18:9 | 18 | assert!(color <= 0xFFF, "12 bit color is smaller than 0xFFF"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc = note: `#[warn(clippy::missing_panics_doc)]` implied by `#[warn(clippy::pedantic)]`
unnecessary hashes around raw string literal: ashen/src/utils/format.rs#L154
warning: unnecessary hashes around raw string literal --> ashen/src/utils/format.rs:154:21 | 154 | r#"{}, {}, {}, 1.0"#, | ^^^^^^^^^^^^^^^^^^^^ ... 292 | r.into_iter().map(|c| display_color!(c)).join(", ") | ----------------- in this macro invocation | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes note: the lint level is defined here --> ashen/src/lib.rs:1:9 | 1 | #![warn(clippy::pedantic)] | ^^^^^^^^^^^^^^^^ = note: `#[warn(clippy::needless_raw_string_hashes)]` implied by `#[warn(clippy::pedantic)]` = note: this warning originates in the macro `display_color` (in Nightly builds, run with -Z macro-backtrace for more info) help: remove all the hashes around the string literal | 154 - r#"{}, {}, {}, 1.0"#, 154 + r"{}, {}, {}, 1.0", |