Skip to content

Commit

Permalink
chore(readme): install dagtoc-bin via paru is not universal at present
Browse files Browse the repository at this point in the history
  • Loading branch information
TD-Sky committed Aug 13, 2023
1 parent ccc619f commit 471850b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dagtoc"
version = "4.0.0"
version = "4.0.1"
authors = ["Collide <[email protected]>"]
edition = "2021"
categories = ["command-line-utilities"]
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ I plan to replace PyMuPDF with mupdf-rs completely once mupdf-rs supports to add
$ paru -S dagtoc
```

- Install binary:

```bash
$ paru -S dagtoc-bin
```



## Usage
Expand Down
12 changes: 6 additions & 6 deletions src/toc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl Toc<UserOutline<'_>> {
}

pub fn offset_pages(&mut self, count: i32) -> Result<(), PageOutbound> {
fn offset_pages_internal(
fn offset_pages_rec(
outlines: &mut [UserOutline<'_>],
count: i32,
) -> Result<(), PageOutbound> {
Expand All @@ -52,14 +52,14 @@ impl Toc<UserOutline<'_>> {
}

if !outline.down.is_empty() {
offset_pages_internal(&mut outline.down, count)?;
offset_pages_rec(&mut outline.down, count)?;
}
}

Ok(())
}

offset_pages_internal(&mut self.0, count)
offset_pages_rec(&mut self.0, count)
}

pub fn as_pytoc(&self) -> Vec<PymupdfOutline<'_>> {
Expand Down Expand Up @@ -108,7 +108,7 @@ impl Toc<Outline> {
}

pub fn offset_pages(&mut self, count: i32) {
fn offset_pages_internal(outlines: &mut [Outline], count: i32) {
fn offset_pages_rec(outlines: &mut [Outline], count: i32) {
for outline in outlines {
if let Some(page) = outline.page.map(|p| p as i32) {
let new_page = page + count;
Expand All @@ -118,11 +118,11 @@ impl Toc<Outline> {
}

if !outline.down.is_empty() {
offset_pages_internal(&mut outline.down, count);
offset_pages_rec(&mut outline.down, count);
}
}
}

offset_pages_internal(&mut self.0, count)
offset_pages_rec(&mut self.0, count)
}
}

0 comments on commit 471850b

Please sign in to comment.