-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): drop dependency on
lexical
The `lexical` crate maintenance status has been called into question while being affected by several soundness issues, as explained in [`RUSTSEC-2023-0055`](https://rustsec.org/advisories/RUSTSEC-2023-0055). However, as far as I can see, we don't really need to use `lexical` in the GLSL preprocessor: - For parsing `#version` numbers, `lexical` didn't provide results that complied with my interpretation of the GLSL specification, which I explained in a code comment, and that I believe motivated a TODO item to move on from `lexical`. Moreover, as `#version` directives are expected to be infrequent (usually, at most one per translation unit), I don't think it's worth to bloat our dependencies with `atoi(_simd|_radix10)`, as `#version` numbers are tiny 16-bit integers where SIMD and bitwise optimizations have a neglible performance impact, so these changes go for correctness and use the INT and UINT token parsing routines to parse these. - For parsing floating point numbers, modern Rust stdlib versions ship a performant algorithm proposed by `lexical`'s author, which negate previous performance gaps between both implementations. Therefore, just use the standard parsing functions in these cases. As far as I am aware, these changes are not semver-breaking because the modified `VersionError` enum was never exposed outside of the `lang-pp` crate.
- Loading branch information
1 parent
d73718f
commit 5dc7eb2
Showing
4 changed files
with
43 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters