Skip to content

Commit

Permalink
remove num dependency in favor of standard library
Browse files Browse the repository at this point in the history
  • Loading branch information
iliazeus committed Oct 12, 2024
1 parent 55e2520 commit c300c59
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 73 deletions.
65 changes: 0 additions & 65 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ anyhow = { version = "1.0.89", features = ["backtrace"] }
bitflags = "2.6.0"
byteorder = "1.5.0"
clap = { version = "4.5.19", features = ["derive"] }
num = "0.4.3"
num_enum = "0.7.3"
sha1 = "0.10.6"

Expand Down
6 changes: 2 additions & 4 deletions src/bin/iso2god.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ use std::fs;
use std::fs::File;
use std::path::{Path, PathBuf};

use num::integer::div_ceil;

use anyhow::{Context, Error};

use clap::{arg, command, Parser};
Expand Down Expand Up @@ -89,8 +87,8 @@ fn main() -> Result<(), Error> {
source_iso_file_meta.len() - root_offset
};

let block_count = div_ceil(data_size, god::BLOCK_SIZE as u64);
let part_count = div_ceil(block_count, god::BLOCKS_PER_PART);
let block_count = data_size.div_ceil(god::BLOCK_SIZE as u64);
let part_count = block_count.div_ceil(god::BLOCKS_PER_PART);

let file_layout = god::FileLayout::new(&args.dest_dir, &exe_info, content_type);

Expand Down
4 changes: 1 addition & 3 deletions src/iso/directory_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ use std::io::{Read, Seek, SeekFrom};

use bitflags::bitflags;

use num::integer::div_ceil;

use anyhow::Error;

use super::*;
Expand Down Expand Up @@ -60,7 +58,7 @@ impl DirectoryTable {
) -> Result<DirectoryTable, Error> {
let mut entries = Vec::<DirectoryEntry>::new();

let sector_count = div_ceil(size, SECTOR_SIZE as u32);
let sector_count = size.div_ceil(SECTOR_SIZE as u32);
for sector_index in 0..sector_count {
let sector_position =
((sector + sector_index) as u64) * volume.sector_size + volume.root_offset;
Expand Down

0 comments on commit c300c59

Please sign in to comment.