Expand description
The shared result and builder of transforms that add tokens to a command line. What: The shared result and builder of fixed transforms that add tokens to a command line. Why: A transform either leaves the caller’s arguments alone or returns a new owned list; saying which lets the caller keep the original vector without comparing contents.
In TS you’d write (pseudocode):
// type ArgumentRewrite = { kind: 'unchanged' } | { kind: 'rewritten'; args: string[] };Enums§
- Argument
Rewrite - What:
The outcome of one transform.
An
enumis a closed set of named alternatives;Rewrittencarries the new owned argument list,Vec<OsString>. Why: The TypeScript rules returned the same array object to mean “unchanged”; Rust says it with a variant instead of object identity.
Functions§
- insert_
tokens - What:
Copy
argumentswithinsertedplaced before indexat.&[&str]borrows a list of text spellings;usizeis the list index type. Why: Injected tokens are ASCII flags, while every existing argument keeps its bytes.