Skip to main content

Crate anitomy_ng

Crate anitomy_ng 

Source
Expand description

Rust port of erengy/anitomy, an anime video filename parser.

The public API (ElementKind, Element, Options, parse) matches upstream; [detail] holds the implementation, one module per upstream C++ header. See anitomy/tests/conformance.rs for the harness that checks output against upstream’s and anitopy’s fixture suites.

Pure, safe Rust: no unsafe, no C dependencies, so it cross-compiles and builds wheels anywhere rustc runs.

This crate parses untrusted, arbitrary filenames, so it must never panic on any input; a panic here would be a denial-of-service bug. The lints below turn the usual panic sources (.unwrap(), .expect(), panic!, unreachable!, direct s[i] indexing) into hard errors under cargo clippy (see tests/no_panic.rs for a runtime check of the same property, which catches what lints can’t, e.g. integer overflow). Prefer .get(i), pattern matching, ?, and .unwrap_or(...) instead.

Structs§

Element
Options
ParseElementKindError
No matching ElementKind for the given string.

Enums§

ElementKind

Functions§

parse
Port of the free function anitomy::parse in include/anitomy.hpp.