You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using progenitor to generate a statically typed httpmock extension, someone might be tempted to put a hyphen inside their crate name:
generator.httpmock(&spec,"something-mock")
This will work for many use cases because package names with hyphens are automatically converted to have underscores, thanks to the fact that hyphens are not valid characters in Rust identifiers. In the case of progenitor, it will fail like so:
called `Result::unwrap()` on an `Err` value: Error("unexpected token")
because, presumably, something and mock are being interpreted as separate identifiers. There's nothing untrue about this error per se, but it really did confuse me until I realized what was actually going on. Perhaps this edge-case should be caught and error explicitly.
The text was updated successfully, but these errors were encountered:
When using progenitor to generate a statically typed httpmock extension, someone might be tempted to put a hyphen inside their crate name:
This will work for many use cases because package names with hyphens are automatically converted to have underscores, thanks to the fact that hyphens are not valid characters in Rust identifiers. In the case of progenitor, it will fail like so:
because, presumably,
something
andmock
are being interpreted as separate identifiers. There's nothing untrue about this error per se, but it really did confuse me until I realized what was actually going on. Perhaps this edge-case should be caught and error explicitly.The text was updated successfully, but these errors were encountered: