More fixes

This commit is contained in:
Luke Street 2024-11-22 00:19:45 -07:00
parent a8bc312dd9
commit 75e6f09b24
4 changed files with 12 additions and 6 deletions

View File

@ -653,7 +653,7 @@ impl<W> WriteCursor<W>
where W: Write
{
fn write_zeroes_until(&mut self, until: u64) -> io::Result<()> {
const ZEROES: [u8; 0x1000] = [0u8; 0x1000];
static ZEROES: [u8; 0x1000] = [0u8; 0x1000];
let mut remaining = until.saturating_sub(self.position);
while remaining > 0 {
let write_len = remaining.min(ZEROES.len() as u64) as usize;

View File

@ -47,7 +47,7 @@ pub const REGION_OFFSET: u64 = 0x4E000;
// ppki (Retail)
pub(crate) const RVL_CERT_ISSUER_PPKI_TICKET: &str = "Root-CA00000001-XS00000003";
#[rustfmt::skip]
pub(crate) const RETAIL_COMMON_KEYS: [KeyBytes; 3] = [
pub(crate) static RETAIL_COMMON_KEYS: [KeyBytes; 3] = [
/* RVL_KEY_RETAIL */
[0xeb, 0xe4, 0x2a, 0x22, 0x5e, 0x85, 0x93, 0xe4, 0x48, 0xd9, 0xc5, 0x45, 0x73, 0x81, 0xaa, 0xf7],
/* RVL_KEY_KOREAN */
@ -59,7 +59,7 @@ pub(crate) const RETAIL_COMMON_KEYS: [KeyBytes; 3] = [
// dpki (Debug)
pub(crate) const RVL_CERT_ISSUER_DPKI_TICKET: &str = "Root-CA00000002-XS00000006";
#[rustfmt::skip]
pub(crate) const DEBUG_COMMON_KEYS: [KeyBytes; 3] = [
pub(crate) static DEBUG_COMMON_KEYS: [KeyBytes; 3] = [
/* RVL_KEY_DEBUG */
[0xa1, 0x60, 0x4a, 0x6a, 0x71, 0x23, 0xb5, 0x29, 0xae, 0x8b, 0xec, 0x32, 0xc8, 0x16, 0xfc, 0xaa],
/* RVL_KEY_KOREAN_DEBUG */

View File

@ -222,7 +222,10 @@ impl dyn PartitionReader + '_ {
/// ```no_run
/// use std::io::Read;
///
/// use nod::read::{DiscOptions, DiscReader, PartitionKind, PartitionOptions};
/// use nod::{
/// common::PartitionKind,
/// read::{DiscOptions, DiscReader, PartitionOptions},
/// };
///
/// fn main() -> nod::Result<()> {
/// let disc = DiscReader::new("path/to/file.iso", &DiscOptions::default())?;
@ -262,7 +265,10 @@ impl dyn PartitionReader {
/// ```no_run
/// use std::io::Read;
///
/// use nod::read::{DiscOptions, DiscReader, OwnedFileReader, PartitionKind, PartitionOptions};
/// use nod::{
/// common::PartitionKind,
/// read::{DiscOptions, DiscReader, OwnedFileReader, PartitionOptions},
/// };
///
/// fn main() -> nod::Result<()> {
/// let disc = DiscReader::new("path/to/file.iso", &DiscOptions::default())?;

View File

@ -721,7 +721,7 @@ where W: Write
fn flush(&mut self) -> io::Result<()> { self.inner.flush() }
}
const ZERO_SECTOR: [u8; SECTOR_SIZE] = [0; SECTOR_SIZE];
static ZERO_SECTOR: [u8; SECTOR_SIZE] = [0; SECTOR_SIZE];
impl<W> Seek for HashStream<W>
where W: Write