Remove PageIdx and LinkIdx again

I don't think the type safety is worth the effort right now.
This commit is contained in:
Joscha 2024-08-25 22:45:20 +02:00
parent 17b118693f
commit 76abf5ea6e
7 changed files with 113 additions and 163 deletions

View file

@ -2,15 +2,13 @@ use std::fs::File;
use std::io::{self, BufReader};
use std::path::Path;
use crate::data::adjacency_list::PageIdx;
use crate::data::store;
pub fn run(datafile: &Path) -> io::Result<()> {
let mut databuf = BufReader::new(File::open(datafile)?);
let data = store::read_adjacency_list(&mut databuf)?;
for (page_idx, page) in data.pages.iter().enumerate() {
let page_idx = PageIdx(page_idx as u32);
for (page_idx, page) in data.pages() {
if page.data.redirect {
for link_idx in data.link_range(page_idx) {
let target_page = data.page(data.link(link_idx).to);