pub fn offset_in(src: &str, part: &str) -> Option<usize>Expand description
One FUNC(...) call in a message value — day lint validates function names and option
values across every locale file with this (the shared fluent-syntax parse, like
message_keys).
Byte offset of part within src, when part is a SUBSLICE of it.
fluent_syntax::parser::parse is generic over the slice type and, given a &str, hands back
an AST whose identifiers and literals borrow straight from the source — so their addresses are
positions in it. That is the whole span story: the 0.12 AST carries no explicit spans, and
re-finding a key by text search would land on the first comment that mentions it.
The byte offset of part within src, when part is a SUBSLICE of it.
Parsers here hand back &str views into the source rather than spans, so the only way to say
where a fragment came from is to compare addresses. Returns None for a string that merely
looks alike but was allocated elsewhere, which is what makes it safe to call on anything.