mirror of
https://github.com/encounter/nod-rs.git
synced 2025-12-12 06:45:08 +00:00
Make gen module private for now; lint fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#![allow(missing_docs)] // TODO
|
||||
#![allow(missing_docs, unused)] // TODO
|
||||
use std::{
|
||||
io,
|
||||
io::{Read, Seek, Write},
|
||||
|
||||
@@ -264,7 +264,7 @@ impl fmt::Display for PartitionKind {
|
||||
impl PartitionKind {
|
||||
/// Returns the directory name for the partition kind.
|
||||
#[inline]
|
||||
pub fn dir_name(&self) -> Cow<str> {
|
||||
pub fn dir_name(&self) -> Cow<'_, str> {
|
||||
match self {
|
||||
Self::Data => Cow::Borrowed("DATA"),
|
||||
Self::Update => Cow::Borrowed("UPDATE"),
|
||||
@@ -356,7 +356,7 @@ impl PartitionInfo {
|
||||
|
||||
/// A view into the file system table (FST).
|
||||
#[inline]
|
||||
pub fn fst(&self) -> Option<Fst> {
|
||||
pub fn fst(&self) -> Option<Fst<'_>> {
|
||||
// FST has already been parsed, so we can safely unwrap
|
||||
Some(Fst::new(self.raw_fst.as_deref()?).unwrap())
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ impl<'a> Fst<'a> {
|
||||
|
||||
/// Iterate over the nodes in the FST.
|
||||
#[inline]
|
||||
pub fn iter(&self) -> FstIter { FstIter { fst: self.clone(), idx: 1, segments: vec![] } }
|
||||
pub fn iter(&self) -> FstIter<'_> { FstIter { fst: self.clone(), idx: 1, segments: vec![] } }
|
||||
|
||||
/// Get the name of a node.
|
||||
pub fn get_name(&self, node: Node) -> Result<Cow<'a, str>, String> {
|
||||
|
||||
@@ -231,7 +231,7 @@ impl DiscReader {
|
||||
/// A reference to the raw FST for GameCube discs.
|
||||
/// For Wii discs, use the FST from the appropriate [PartitionInfo].
|
||||
#[inline]
|
||||
pub fn fst(&self) -> Option<Fst> {
|
||||
pub fn fst(&self) -> Option<Fst<'_>> {
|
||||
match &self.disc_data {
|
||||
DiscReaderData::GameCube { raw_fst } => {
|
||||
raw_fst.as_deref().and_then(|v| Fst::new(v).ok())
|
||||
|
||||
@@ -147,7 +147,8 @@
|
||||
//! // ...
|
||||
//! ```
|
||||
|
||||
pub mod build;
|
||||
// [WIP] Disc image building is incomplete and not yet exposed.
|
||||
pub(crate) mod build;
|
||||
pub mod common;
|
||||
pub mod disc;
|
||||
pub(crate) mod io;
|
||||
|
||||
@@ -359,7 +359,7 @@ impl dyn PartitionReader + '_ {
|
||||
/// Ok(())
|
||||
/// }
|
||||
/// ```
|
||||
pub fn open_file(&mut self, node: Node) -> io::Result<FileReader> {
|
||||
pub fn open_file(&mut self, node: Node) -> io::Result<FileReader<'_>> {
|
||||
if !node.is_file() {
|
||||
return Err(io::Error::new(
|
||||
io::ErrorKind::InvalidInput,
|
||||
@@ -475,7 +475,7 @@ impl PartitionMeta {
|
||||
|
||||
/// A view into the file system table (FST).
|
||||
#[inline]
|
||||
pub fn fst(&self) -> Result<Fst, &'static str> { Fst::new(&self.raw_fst) }
|
||||
pub fn fst(&self) -> Result<Fst<'_>, &'static str> { Fst::new(&self.raw_fst) }
|
||||
|
||||
/// A view into the DOL header.
|
||||
#[inline]
|
||||
|
||||
Reference in New Issue
Block a user