Expand description
Where the module walk starts: the library target’s root file.
Cargo takes it from [lib] path in Cargo.toml. Without that key the lint
keeps its two guesses: src/lib.rs when the crate has a src/ directory,
else lib.rs next to Cargo.toml (every scaffolded R package sets
[lib] path = "lib.rs", so the guess only matters for manifests without it).
The key is read with a small line-based scanner, so the lint gains no TOML
dependency. Mirror of the reader in miniextendr-macros/src/crate_config.rs
(normalize_key, parse_string_value): the current table header is tracked
and every key = value line resolves to a dotted path, so [lib] followed by
path = "..." and a top-level lib.path = "..." are the same key, and a
path under any other table ([[bin]], [package], [dependencies.lib]) is
a different one.
Structs§
- Crate
Root - The library target’s root file, resolved for a manifest directory.
Enums§
- Root
Origin - Where
CrateRoot::filecame from.
Constants§
- LIB_
PATH_ 🔒KEY - Dotted path of the key that names the library target’s root file.
Functions§
- inline_
table_ 🔒has_ path - Whether a one-line inline table names a
pathkey. Splitting on,can cut an array or a string apart, but every key still starts a piece of its own. - lib_
path_ 🔒from_ manifest - The
[lib] pathvalue of manifest text,Nonewhen the key is absent. - normalize 🔒
manifest_dir.join(path)without.components, sopath = "./lib.rs"names the same file aspath = "lib.rs".- normalize_
key 🔒 - Collapse a dotted key or table header to
a.b.c: trims each segment and strips one layer of quotes so[ "lib" ]compares equal to[lib]. - parse_
string_ 🔒value - Parse a single-line TOML basic (
"...") or literal ('...') string, allowing a trailing# comment. Escape sequences in a basic string, multi-line strings and non-string values returnNone. Unlike the macro crate’s copy, a literal string keeps its backslashes (TOML has no escapes there), sopath = 'rust\lib.rs'reads as written. - prose_
links_ 🔒keep - Whether the crate sets
roxygen_prose_links = "keep"under[package.metadata.miniextendr]: leading doc prose then keeps its links on the way to roxygen2. Same line scanner aslib_path_from_manifest; a missing, unreadable or malformed value reads as the default ("strip").