Skip to content

Refactor: Replace custom path utilities with Path API and update zip methods accordingly - #775

Merged
NSoiffer merged 1 commit into
daisy:mainfrom
moritz-gross:refactor/use-Path-API-instead-of-str-helpers
Sep 24, 2026
Merged

NSoiffer merged 1 commit into
daisy:mainfrom
moritz-gross:refactor/use-Path-API-instead-of-str-helpers

Conversation

@moritz-gross

@moritz-gross moritz-gross commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator
  • reduces LOC by 10
  • having proper types instead of str is safer imo

Side note: This file also contains some unused imports. should I remove them as well?

and I'm surprised somewhat that the previous implementation is not buggy in some way?? hard-coding a path separator like "/" is usually a bad idea from my experience, given the kinds of this operating systems are doing.

@NSoiffer

Copy link
Copy Markdown
Collaborator

@moritz-gross Except for some special cases, "/" works everywhere in Rust. There is MAIN_SEPARATOR, but is obviously bulkier and less readable.

Please test this with feature = "include-zip". There is code in shim-filesystem.rs that wan't to have "/"s due to dealing with zip files.

@moritz-gross

Copy link
Copy Markdown
Collaborator Author

cargo test --features include-zip passes

(I'm getting this warning though, which is fine I guess: warning: methods rule_files_cache_is_empty, definitions_files_cache_is_empty, and definitions_files_cache_path are never used )

I've not used the flag --features include-zip before.

@moritz-gross moritz-gross added the rust Coding in Rust label Sep 20, 2026
@NSoiffer
NSoiffer merged commit fc7d939 into daisy:main Sep 24, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from Triage to Done in MathCAT Project Board Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Coding in Rust

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants