-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid string allocation to get length of port #823
Conversation
Ah, the CI is targeting 1.51.0 but |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #823 +/- ##
=======================================
Coverage 82.73% 82.73%
=======================================
Files 20 20
Lines 3330 3337 +7
=======================================
+ Hits 2755 2761 +6
- Misses 575 576 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
It can be something like https://stackoverflow.com/a/69298721 where you simply multiply by 10 and compare. |
67e60b2
to
09090fd
Compare
I have made it a fallback with some tests for edge cases. What do you think? |
How about a simple match statement? https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b2fffe2e3cc3683b55cf4d0e0789795b fn count_digits(n: u16) -> u8 {
match n {
0..=9 => 1,
10..=99 => 2,
100..=999 => 3,
1000..=9999 => 4,
10000..=65535 => 5,
}
} |
They compile to the same binary! In fact, even for u32 or u64, the compiler just unrolls the loop. It does use a trick for u64 because there are no CMP instructions with an immediate 64 bit value on x86_64 (if I understand correctly). In any case, your version looks much nicer, and it is much easier to convince oneself that it is correct, so I have pushed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🙏
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---|---|---| | [clap](https://togithub.com/clap-rs/clap) | dependencies | patch | `4.3.0` -> `4.3.3` | [![age](https://badges.renovateapi.com/packages/crate/clap/4.3.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/crate/clap/4.3.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/crate/clap/4.3.3/compatibility-slim/4.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/crate/clap/4.3.3/confidence-slim/4.3.0)](https://docs.renovatebot.com/merge-confidence/) | | [dd-trace](https://togithub.com/DataDog/dd-trace-js) | dependencies | minor | [`3.21.0` -> `3.22.1`](https://renovatebot.com/diffs/npm/dd-trace/3.21.0/3.22.1) | [![age](https://badges.renovateapi.com/packages/npm/dd-trace/3.22.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/dd-trace/3.22.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/dd-trace/3.22.1/compatibility-slim/3.21.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/dd-trace/3.22.1/confidence-slim/3.21.0)](https://docs.renovatebot.com/merge-confidence/) | | [flate2](https://togithub.com/rust-lang/flate2-rs) | dependencies | patch | `1.0.24` -> `1.0.26` | [![age](https://badges.renovateapi.com/packages/crate/flate2/1.0.26/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/crate/flate2/1.0.26/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/crate/flate2/1.0.26/compatibility-slim/1.0.24)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/crate/flate2/1.0.26/confidence-slim/1.0.24)](https://docs.renovatebot.com/merge-confidence/) | | [once_cell](https://togithub.com/matklad/once_cell) | dev-dependencies | minor | `1.17.2` -> `1.18.0` | [![age](https://badges.renovateapi.com/packages/crate/once_cell/1.18.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/crate/once_cell/1.18.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/crate/once_cell/1.18.0/compatibility-slim/1.17.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/crate/once_cell/1.18.0/confidence-slim/1.17.2)](https://docs.renovatebot.com/merge-confidence/) | | [once_cell](https://togithub.com/matklad/once_cell) | dependencies | minor | `1.17.2` -> `1.18.0` | [![age](https://badges.renovateapi.com/packages/crate/once_cell/1.18.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/crate/once_cell/1.18.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/crate/once_cell/1.18.0/compatibility-slim/1.17.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/crate/once_cell/1.18.0/confidence-slim/1.17.2)](https://docs.renovatebot.com/merge-confidence/) | | [regex](https://togithub.com/rust-lang/regex) | dependencies | patch | `1.8.3` -> `1.8.4` | [![age](https://badges.renovateapi.com/packages/crate/regex/1.8.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/crate/regex/1.8.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/crate/regex/1.8.4/compatibility-slim/1.8.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/crate/regex/1.8.4/confidence-slim/1.8.3)](https://docs.renovatebot.com/merge-confidence/) | | [rust-embed](https://togithub.com/pyros2097/rust-embed) | dependencies | minor | `6.6.1` -> `6.7.0` | [![age](https://badges.renovateapi.com/packages/crate/rust-embed/6.7.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/crate/rust-embed/6.7.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/crate/rust-embed/6.7.0/compatibility-slim/6.6.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/crate/rust-embed/6.7.0/confidence-slim/6.6.1)](https://docs.renovatebot.com/merge-confidence/) | | [serde](https://serde.rs) ([source](https://togithub.com/serde-rs/serde)) | dependencies | patch | `1.0.163` -> `1.0.164` | [![age](https://badges.renovateapi.com/packages/crate/serde/1.0.164/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/crate/serde/1.0.164/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/crate/serde/1.0.164/compatibility-slim/1.0.163)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/crate/serde/1.0.164/confidence-slim/1.0.163)](https://docs.renovatebot.com/merge-confidence/) | | [tempfile](https://stebalien.com/projects/tempfile-rs/) ([source](https://togithub.com/Stebalien/tempfile)) | dev-dependencies | minor | `3.5.0` -> `3.6.0` | [![age](https://badges.renovateapi.com/packages/crate/tempfile/3.6.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/crate/tempfile/3.6.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/crate/tempfile/3.6.0/compatibility-slim/3.5.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/crate/tempfile/3.6.0/confidence-slim/3.5.0)](https://docs.renovatebot.com/merge-confidence/) | | [typescript](https://www.typescriptlang.org/) ([source](https://togithub.com/Microsoft/TypeScript)) | devDependencies | minor | [`5.0.4` -> `5.1.3`](https://renovatebot.com/diffs/npm/typescript/5.0.4/5.1.3) | [![age](https://badges.renovateapi.com/packages/npm/typescript/5.1.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/typescript/5.1.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/typescript/5.1.3/compatibility-slim/5.0.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/typescript/5.1.3/confidence-slim/5.0.4)](https://docs.renovatebot.com/merge-confidence/) | | [url](https://togithub.com/servo/rust-url) | dependencies | minor | `2.3.1` -> `2.4.0` | [![age](https://badges.renovateapi.com/packages/crate/url/2.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/crate/url/2.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/crate/url/2.4.0/compatibility-slim/2.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/crate/url/2.4.0/confidence-slim/2.3.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>clap-rs/clap</summary> ### [`v4.3.3`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#​433---2023-06-09) [Compare Source](https://togithub.com/clap-rs/clap/compare/v4.3.2...v4.3.3) ##### Features - `Command::defer` for delayed initialization of subcommands to reduce startup times of large applications like deno ### [`v4.3.2`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#​432---2023-06-05) [Compare Source](https://togithub.com/clap-rs/clap/compare/v4.3.1...v4.3.2) ##### Fixes - *(derive)* Don't produce `unused_equalifications` warnings when someone brings a clap type into scope ### [`v4.3.1`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#​431---2023-06-02) [Compare Source](https://togithub.com/clap-rs/clap/compare/v4.3.0...v4.3.1) ##### Performance - *(derive)* Reduce the amount of generated code </details> <details> <summary>DataDog/dd-trace-js</summary> ### [`v3.22.1`](https://togithub.com/DataDog/dd-trace-js/releases/tag/v3.22.1) [Compare Source](https://togithub.com/DataDog/dd-trace-js/compare/v3.22.0...v3.22.1) ##### Bug Fixes - **pg**: do not throw when query contains getter ([#​3212](https://togithub.com/DataDog/dd-trace-js/issues/3212)) - **esbuild**: graceful continue when bundling dead code ([#​3215](https://togithub.com/DataDog/dd-trace-js/issues/3215)) ##### Improvements - **express**: improve express regex middleware path parsing ([#​3203](https://togithub.com/DataDog/dd-trace-js/issues/3203)) - **core**: include send-data missing headers and organize telemetry config variables ([#​3055](https://togithub.com/DataDog/dd-trace-js/issues/3055)) - **ci**: add ability to create and publish .deb and .rpm packages ([#​3189](https://togithub.com/DataDog/dd-trace-js/issues/3189)) ### [`v3.22.0`](https://togithub.com/DataDog/dd-trace-js/releases/tag/v3.22.0): 3.22.0 [Compare Source](https://togithub.com/DataDog/dd-trace-js/compare/v3.21.0...v3.22.0) ##### Features - **waf:** Support RC custom rules ([#​3126](https://togithub.com/DataDog/dd-trace-js/issues/3126)) - **waf:** Update blocking page and status from RC ([#​3195](https://togithub.com/DataDog/dd-trace-js/issues/3195)) - **iast:** Detect SSRF vulnerabilities ([#​3115](https://togithub.com/DataDog/dd-trace-js/issues/3115)) - **iast:** Detect Insecure cookie vulnerabilities ([#​3184](https://togithub.com/DataDog/dd-trace-js/issues/3184)) ##### Improvements - **profiling:** Use process as default strategy for oom export ([#​3136](https://togithub.com/DataDog/dd-trace-js/issues/3136)) - **tracer:** Service Naming API ([#​3161](https://togithub.com/DataDog/dd-trace-js/issues/3161), [#​2941](https://togithub.com/DataDog/dd-trace-js/issues/2941), [#​2961](https://togithub.com/DataDog/dd-trace-js/issues/2961)) - **tracer:** Cache integrations - Service Naming ([#​3056](https://togithub.com/DataDog/dd-trace-js/issues/3056)) - **tracer:** More beautiful debug logs ([#​3171](https://togithub.com/DataDog/dd-trace-js/issues/3171)) - **tracer:** postgres: DBM full service fallback w/ prepared statements ([#​3186](https://togithub.com/DataDog/dd-trace-js/issues/3186)) - **tracer:** Make HTTP clients fit in the plugin hierarchy ([#​3178](https://togithub.com/DataDog/dd-trace-js/issues/3178)) - **ci-visibility:** Extract code coverage from cypress ([#​3159](https://togithub.com/DataDog/dd-trace-js/issues/3159)) - **ci-visibility:** Change gitlab's pipeline URL extraction ([#​3183](https://togithub.com/DataDog/dd-trace-js/issues/3183)) - **ci-visibility:** Test skipping logic for cypress ([#​3167](https://togithub.com/DataDog/dd-trace-js/issues/3167)) - **waf:** Update AppSec blocking templates ([#​3181](https://togithub.com/DataDog/dd-trace-js/issues/3181)) - **waf:** Update AppSec rules to 1.7.1 ([#​3185](https://togithub.com/DataDog/dd-trace-js/issues/3185)) - **iast:** Detect SQL injection with sequelize ([#​3154](https://togithub.com/DataDog/dd-trace-js/issues/3154)) ##### Bug Fixes - **iast:** Fix evidence redaction ([#​3160](https://togithub.com/DataDog/dd-trace-js/issues/3160)) - **iast:** Fix path traversal vulnerability detection on close file ([#​3172](https://togithub.com/DataDog/dd-trace-js/issues/3172)) - **ci-visibility:** Fix cucumber parallel mode ([#​3156](https://togithub.com/DataDog/dd-trace-js/issues/3156)) - **ci-visibility:** Remove git.properties error log ([#​3179](https://togithub.com/DataDog/dd-trace-js/issues/3179)) - **ci-visibility:** Fix [email protected] ([#​3180](https://togithub.com/DataDog/dd-trace-js/issues/3180)) - **waf:** Fix ASM_DD batch update ([#​3165](https://togithub.com/DataDog/dd-trace-js/issues/3165)) </details> <details> <summary>rust-lang/flate2-rs</summary> ### [`v1.0.26`](https://togithub.com/rust-lang/flate2-rs/releases/tag/1.0.26) [Compare Source](https://togithub.com/rust-lang/flate2-rs/compare/1.0.25...1.0.26) #### What's Changed - Add decompress file example by [@​MichaelMcDonnell](https://togithub.com/MichaelMcDonnell) in [https://github.com/rust-lang/flate2-rs/pull/329](https://togithub.com/rust-lang/flate2-rs/pull/329) - Remove `extern crate`s by [@​JohnTitor](https://togithub.com/JohnTitor) in [https://github.com/rust-lang/flate2-rs/pull/331](https://togithub.com/rust-lang/flate2-rs/pull/331) - Make clippy happy + a few more cleanups by [@​nyurik](https://togithub.com/nyurik) in [https://github.com/rust-lang/flate2-rs/pull/285](https://togithub.com/rust-lang/flate2-rs/pull/285) - Fix left-overs on decoder docs by [@​JohnTitor](https://togithub.com/JohnTitor) in [https://github.com/rust-lang/flate2-rs/pull/333](https://togithub.com/rust-lang/flate2-rs/pull/333) - Mention MSRV policy by [@​JohnTitor](https://togithub.com/JohnTitor) in [https://github.com/rust-lang/flate2-rs/pull/332](https://togithub.com/rust-lang/flate2-rs/pull/332) - Bump miniz-oxide to prevent assertion failure by [@​softdevca](https://togithub.com/softdevca) in [https://github.com/rust-lang/flate2-rs/pull/335](https://togithub.com/rust-lang/flate2-rs/pull/335) - Enable all-features, Use doc_auto_cfg on docs.rs by [@​wcampbell0x2a](https://togithub.com/wcampbell0x2a) in [https://github.com/rust-lang/flate2-rs/pull/336](https://togithub.com/rust-lang/flate2-rs/pull/336) - Fix a typo in doc for write::GzDecoder by [@​yestyle](https://togithub.com/yestyle) in [https://github.com/rust-lang/flate2-rs/pull/337](https://togithub.com/rust-lang/flate2-rs/pull/337) - Fixed overflow bug in crc combine by [@​AntonJMLarsson](https://togithub.com/AntonJMLarsson) in [https://github.com/rust-lang/flate2-rs/pull/330](https://togithub.com/rust-lang/flate2-rs/pull/330) - Added feature for enabling default zlib-sys features by [@​taco-paco](https://togithub.com/taco-paco) in [https://github.com/rust-lang/flate2-rs/pull/322](https://togithub.com/rust-lang/flate2-rs/pull/322) - Add write::MultiGzDecoder for multi-member gzip data by [@​jongiddy](https://togithub.com/jongiddy) in [https://github.com/rust-lang/flate2-rs/pull/325](https://togithub.com/rust-lang/flate2-rs/pull/325) - gha: Upgrade to windows-2022 by [@​JohnTitor](https://togithub.com/JohnTitor) in [https://github.com/rust-lang/flate2-rs/pull/343](https://togithub.com/rust-lang/flate2-rs/pull/343) - gha: Specify tag instead of branch on actions/checkout by [@​JohnTitor](https://togithub.com/JohnTitor) in [https://github.com/rust-lang/flate2-rs/pull/342](https://togithub.com/rust-lang/flate2-rs/pull/342) - Prepare 1.0.26 release by [@​JohnTitor](https://togithub.com/JohnTitor) in [https://github.com/rust-lang/flate2-rs/pull/341](https://togithub.com/rust-lang/flate2-rs/pull/341) #### New Contributors - [@​MichaelMcDonnell](https://togithub.com/MichaelMcDonnell) made their first contribution in [https://github.com/rust-lang/flate2-rs/pull/329](https://togithub.com/rust-lang/flate2-rs/pull/329) - [@​JohnTitor](https://togithub.com/JohnTitor) made their first contribution in [https://github.com/rust-lang/flate2-rs/pull/331](https://togithub.com/rust-lang/flate2-rs/pull/331) - [@​softdevca](https://togithub.com/softdevca) made their first contribution in [https://github.com/rust-lang/flate2-rs/pull/335](https://togithub.com/rust-lang/flate2-rs/pull/335) - [@​wcampbell0x2a](https://togithub.com/wcampbell0x2a) made their first contribution in [https://github.com/rust-lang/flate2-rs/pull/336](https://togithub.com/rust-lang/flate2-rs/pull/336) - [@​yestyle](https://togithub.com/yestyle) made their first contribution in [https://github.com/rust-lang/flate2-rs/pull/337](https://togithub.com/rust-lang/flate2-rs/pull/337) - [@​AntonJMLarsson](https://togithub.com/AntonJMLarsson) made their first contribution in [https://github.com/rust-lang/flate2-rs/pull/330](https://togithub.com/rust-lang/flate2-rs/pull/330) - [@​taco-paco](https://togithub.com/taco-paco) made their first contribution in [https://github.com/rust-lang/flate2-rs/pull/322](https://togithub.com/rust-lang/flate2-rs/pull/322) - [@​jongiddy](https://togithub.com/jongiddy) made their first contribution in [https://github.com/rust-lang/flate2-rs/pull/325](https://togithub.com/rust-lang/flate2-rs/pull/325) **Full Changelog**: rust-lang/flate2-rs@1.0.25...1.0.26 ### [`v1.0.25`](https://togithub.com/rust-lang/flate2-rs/releases/tag/1.0.25) [Compare Source](https://togithub.com/rust-lang/flate2-rs/compare/1.0.24...1.0.25) #### What's Changed - Use SPDX license format and update links by [@​atouchet](https://togithub.com/atouchet) in [https://github.com/rust-lang/flate2-rs/pull/296](https://togithub.com/rust-lang/flate2-rs/pull/296) - Bump miniz_oxide to 0.6 by [@​paolobarbolini](https://togithub.com/paolobarbolini) in [https://github.com/rust-lang/flate2-rs/pull/317](https://togithub.com/rust-lang/flate2-rs/pull/317) - Prep release 1.0.25 by [@​thomcc](https://togithub.com/thomcc) in [https://github.com/rust-lang/flate2-rs/pull/327](https://togithub.com/rust-lang/flate2-rs/pull/327) #### New Contributors - [@​atouchet](https://togithub.com/atouchet) made their first contribution in [https://github.com/rust-lang/flate2-rs/pull/296](https://togithub.com/rust-lang/flate2-rs/pull/296) - [@​paolobarbolini](https://togithub.com/paolobarbolini) made their first contribution in [https://github.com/rust-lang/flate2-rs/pull/317](https://togithub.com/rust-lang/flate2-rs/pull/317) - [@​thomcc](https://togithub.com/thomcc) made their first contribution in [https://github.com/rust-lang/flate2-rs/pull/327](https://togithub.com/rust-lang/flate2-rs/pull/327) **Full Changelog**: rust-lang/flate2-rs@1.0.24...1.0.25 </details> <details> <summary>matklad/once_cell</summary> ### [`v1.18.0`](https://togithub.com/matklad/once_cell/blob/HEAD/CHANGELOG.md#​1180) [Compare Source](https://togithub.com/matklad/once_cell/compare/v1.17.2...v1.18.0) - `MSRV` is updated to 1.60.0 to take advantage of `dep:` syntax for cargo features, removing "implementation details" from publicly visible surface. </details> <details> <summary>rust-lang/regex</summary> ### [`v1.8.4`](https://togithub.com/rust-lang/regex/blob/HEAD/CHANGELOG.md#​184-2023-06-05) [Compare Source](https://togithub.com/rust-lang/regex/compare/1.8.3...1.8.4) \================== This is a patch release that fixes a bug where `(?-u:\B)` was allowed in Unicode regexes, despite the fact that the current matching engines can report match offsets between the code units of a single UTF-8 encoded codepoint. That in turn means that match offsets that split a codepoint could be reported, which in turn results in panicking when one uses them to slice a `&str`. This bug occurred in the transition to `regex 1.8` because the underlying syntactical error that prevented this regex from compiling was intentionally removed. That's because `(?-u:\B)` will be permitted in Unicode regexes in `regex 1.9`, but the matching engines will guarantee to never report match offsets that split a codepoint. When the underlying syntactical error was removed, no code was added to ensure that `(?-u:\B)` didn't compile in the `regex 1.8` transition release. This release, `regex 1.8.4`, adds that code such that `Regex::new(r"(?-u:\B)")` returns to the `regex <1.8` behavior of not compiling. (A `bytes::Regex` can still of course compile it.) Bug fixes: - [BUG #​1006](https://togithub.com/rust-lang/regex/issues/1006): Fix a bug where `(?-u:\B)` was allowed in Unicode regexes, and in turn could lead to match offsets that split a codepoint in `&str`. </details> <details> <summary>pyros2097/rust-embed</summary> ### [`v6.7.0`](https://togithub.com/pyros2097/rust-embed/blob/HEAD/changelog.md#​670---2023-06-09) - Update `syn` to v2.0 [#​211](https://togithub.com/pyrossh/rust-embed/issues/211) </details> <details> <summary>serde-rs/serde</summary> ### [`v1.0.164`](https://togithub.com/serde-rs/serde/releases/tag/v1.0.164) [Compare Source](https://togithub.com/serde-rs/serde/compare/v1.0.163...v1.0.164) - Allowed enum variants to be individually marked as untagged ([#​2403](https://togithub.com/serde-rs/serde/issues/2403), thanks [@​dewert99](https://togithub.com/dewert99)) </details> <details> <summary>Stebalien/tempfile</summary> ### [`v3.6.0`](https://togithub.com/Stebalien/tempfile/blob/HEAD/CHANGELOG.md#​360) [Compare Source](https://togithub.com/Stebalien/tempfile/compare/v3.5.0...v3.6.0) - Update windows-sys to 0.48. - Update rustix min version to 0.37.11 - Forward some `NamedTempFile` and `SpooledTempFile` methods to the underlying `File` object for better performance (especially vectorized writes, etc.). - Implement `AsFd` and `AsHandle`. - Misc documentation fixes and code cleanups. </details> <details> <summary>Microsoft/TypeScript</summary> ### [`v5.1.3`](https://togithub.com/microsoft/TypeScript/releases/tag/v5.1.3): TypeScript 5.1.3 [Compare Source](https://togithub.com/Microsoft/TypeScript/compare/v5.0.4...v5.1.3) For release notes, check out the [release announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-5-1/). For the complete list of fixed issues, check out the - [fixed issues query for Typescript 5.1.0 (Beta)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=milestone%3A%22TypeScript+5.1.0%22+is%3Aclosed+). - [fixed issues query for Typescript 5.1.1 (RC)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=milestone%3A%22TypeScript+5.1.1%22+is%3Aclosed+). - [fixed issues query for Typescript 5.1.3 (Stable)](https://togithub.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93\&q=milestone%3A%22TypeScript+5.1.3%22+is%3Aclosed+). Downloads are available on: - [NuGet package](https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild) </details> <details> <summary>servo/rust-url</summary> ### [`v2.4.0`](https://togithub.com/servo/rust-url/releases/tag/v2.4.0) [Compare Source](https://togithub.com/servo/rust-url/compare/v2.3.1...v2.4.0) #### Crate version bump - data-url to 0.3.0 - percent-encoding to 2.3.0 - form_urlencoded to 1.2.0 - idna to 0.4.0 - url to 2.4.0 #### What's Changed - url: add the authority method by [@​unleashed](https://togithub.com/unleashed) in [https://github.com/servo/rust-url/pull/674](https://togithub.com/servo/rust-url/pull/674) - Fix clippy warnings by [@​nickelc](https://togithub.com/nickelc) in [https://github.com/servo/rust-url/pull/810](https://togithub.com/servo/rust-url/pull/810) - Replace unmaintained/outdated github actions by [@​nickelc](https://togithub.com/nickelc) in [https://github.com/servo/rust-url/pull/811](https://togithub.com/servo/rust-url/pull/811) - Implement potentially strip spaces for opaque paths by [@​CYBAI](https://togithub.com/CYBAI) in [https://github.com/servo/rust-url/pull/813](https://togithub.com/servo/rust-url/pull/813) - percent_encoding: faster percent_encode_byte by [@​klensy](https://togithub.com/klensy) in [https://github.com/servo/rust-url/pull/814](https://togithub.com/servo/rust-url/pull/814) - Update urltestdata.json WPT test cases by [@​valenting](https://togithub.com/valenting) in [https://github.com/servo/rust-url/pull/819](https://togithub.com/servo/rust-url/pull/819) - Fix anarchist URL where path starts with // by [@​qsantos](https://togithub.com/qsantos) in [https://github.com/servo/rust-url/pull/817](https://togithub.com/servo/rust-url/pull/817) - Avoid string allocation to get length of port by [@​qsantos](https://togithub.com/qsantos) in [https://github.com/servo/rust-url/pull/823](https://togithub.com/servo/rust-url/pull/823) - No colon when setting empty password by [@​qsantos](https://togithub.com/qsantos) in [https://github.com/servo/rust-url/pull/825](https://togithub.com/servo/rust-url/pull/825) - Url is special by [@​qsantos](https://togithub.com/qsantos) in [https://github.com/servo/rust-url/pull/826](https://togithub.com/servo/rust-url/pull/826) - Update msrv to 1.56 to keep up with serde-derive by [@​valenting](https://togithub.com/valenting) in [https://github.com/servo/rust-url/pull/827](https://togithub.com/servo/rust-url/pull/827) - `no_std` support for `form_urlencoded`, `data-url` and `idna` by [@​madsmtm](https://togithub.com/madsmtm) in [https://github.com/servo/rust-url/pull/722](https://togithub.com/servo/rust-url/pull/722) - Compile with serde feature on Rust playground and docs.rs by [@​dtolnay](https://togithub.com/dtolnay) in [https://github.com/servo/rust-url/pull/832](https://togithub.com/servo/rust-url/pull/832) - Fix issues with file drives by [@​valenting](https://togithub.com/valenting) in [https://github.com/servo/rust-url/pull/839](https://togithub.com/servo/rust-url/pull/839) - Update url to 2.4.0 and release new version by [@​valenting](https://togithub.com/valenting) in [https://github.com/servo/rust-url/pull/840](https://togithub.com/servo/rust-url/pull/840) #### New Contributors - [@​nickelc](https://togithub.com/nickelc) made their first contribution in [https://github.com/servo/rust-url/pull/810](https://togithub.com/servo/rust-url/pull/810) - [@​CYBAI](https://togithub.com/CYBAI) made their first contribution in [https://github.com/servo/rust-url/pull/813](https://togithub.com/servo/rust-url/pull/813) - [@​klensy](https://togithub.com/klensy) made their first contribution in [https://github.com/servo/rust-url/pull/814](https://togithub.com/servo/rust-url/pull/814) - [@​qsantos](https://togithub.com/qsantos) made their first contribution in [https://github.com/servo/rust-url/pull/817](https://togithub.com/servo/rust-url/pull/817) - [@​madsmtm](https://togithub.com/madsmtm) made their first contribution in [https://github.com/servo/rust-url/pull/722](https://togithub.com/servo/rust-url/pull/722) - [@​dtolnay](https://togithub.com/dtolnay) made their first contribution in [https://github.com/servo/rust-url/pull/832](https://togithub.com/servo/rust-url/pull/832) **Full Changelog**: servo/rust-url@v2.3.1...v2.4.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/apollographql/router). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMDUuMiIsInVwZGF0ZWRJblZlciI6IjM1LjExMC4wIiwidGFyZ2V0QnJhbmNoIjoiZGV2In0=--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: o0Ignition0o <[email protected]>
151: fix(deps): update rust crate camino to 1.1.6 r=renovate[bot] a=renovate[bot] [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [camino](https://togithub.com/camino-rs/camino) | dependencies | minor | `1.0.9` -> `1.1.6` | --- ### Release Notes <details> <summary>camino-rs/camino (camino)</summary> ### [`v1.1.6`](https://togithub.com/camino-rs/camino/blob/HEAD/CHANGELOG.md#116---2023-07-11) [Compare Source](https://togithub.com/camino-rs/camino/compare/camino-1.1.4...camino-1.1.6) ##### Added - Implement `Deserialize` for `Box<Utf8Path>`. ### [`v1.1.4`](https://togithub.com/camino-rs/camino/blob/HEAD/CHANGELOG.md#114---2023-03-09) [Compare Source](https://togithub.com/camino-rs/camino/compare/camino-1.1.3...camino-1.1.4) ##### Added - Implement `DerefMut` for `Utf8PathBuf` on Rust 1.68 and above. ### [`v1.1.3`](https://togithub.com/camino-rs/camino/blob/HEAD/CHANGELOG.md#113---2023-02-21) [Compare Source](https://togithub.com/camino-rs/camino/compare/camino-1.1.2...camino-1.1.3) ##### Added - New method `Utf8DirEntry::into_path` to return an owned `Utf8PathBuf`. ### [`v1.1.2`](https://togithub.com/camino-rs/camino/blob/HEAD/CHANGELOG.md#112---2022-08-12) [Compare Source](https://togithub.com/camino-rs/camino/compare/camino-1.1.1...camino-1.1.2) ##### Added - New convenience methods \[`FromPathBufError::into_io_error`] and \[`FromPathError::into_io_error`]. ### [`v1.1.1`](https://togithub.com/camino-rs/camino/blob/HEAD/CHANGELOG.md#111---2022-08-12) [Compare Source](https://togithub.com/camino-rs/camino/compare/camino-1.1.0...camino-1.1.1) ##### Fixed - Fixed a build regression on older nightlies in the 1.63 series ([#​22](https://togithub.com/camino-rs/camino/issues/22)). - Documentation fixes. ### [`v1.1.0`](https://togithub.com/camino-rs/camino/blob/HEAD/CHANGELOG.md#110---2022-08-11) [Compare Source](https://togithub.com/camino-rs/camino/compare/camino-1.0.9...camino-1.1.0) ##### Added - New methods, mirroring those in recent versions of Rust: - `Utf8Path::try_exists` checks whether a path exists. Note that while `std::path::Path` only provides this method for Rust 1.58 and above, `camino` backfills the method for all Rust versions it supports. - `Utf8PathBuf::shrink_to` shrinks a `Utf8PathBuf` to a given size. This was added in, and is gated on, Rust 1.56+. - `Utf8PathBuf::try_reserve` and `Utf8PathBuf::try_reserve_exact` implement fallible allocations. These were added in, and are gated on, Rust 1.63+. - A number of `#[must_use]` annotations to APIs, mirroring those added to `Path` and `PathBuf` in recent versions of Rust. The minor version bump is due to this change. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/jaysonsantos/aur-pkgbuild-updater). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi42OC4xIiwidXBkYXRlZEluVmVyIjoiMzYuNjguMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> 153: fix(deps): update rust crate url to 2.4.1 r=renovate[bot] a=renovate[bot] [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [url](https://togithub.com/servo/rust-url) | dependencies | minor | `2.2.2` -> `2.4.1` | --- ### Release Notes <details> <summary>servo/rust-url (url)</summary> ### [`v2.4.1`](https://togithub.com/servo/rust-url/releases/tag/v2.4.1) [Compare Source](https://togithub.com/servo/rust-url/compare/v2.4.0...v2.4.1) #### What's Changed - Move debugger_visualizer tests to separate crate by [`@​lucacasonato](https://togithub.com/lucacasonato)` in [https://github.com/servo/rust-url/pull/853](https://togithub.com/servo/rust-url/pull/853) - Remove obsolete badge references by [`@​atouchet](https://togithub.com/atouchet)` in [https://github.com/servo/rust-url/pull/852](https://togithub.com/servo/rust-url/pull/852) - Fix trailing spaces in scheme / pathname / search setters by [`@​lucacasonato](https://togithub.com/lucacasonato)` in [https://github.com/servo/rust-url/pull/848](https://togithub.com/servo/rust-url/pull/848) - fix: implement std::error::Error for data-url by [`@​lucacasonato](https://togithub.com/lucacasonato)` in [https://github.com/servo/rust-url/pull/698](https://togithub.com/servo/rust-url/pull/698) - Enable the GitHub merge queue by [`@​mrobinson](https://togithub.com/mrobinson)` in [https://github.com/servo/rust-url/pull/851](https://togithub.com/servo/rust-url/pull/851) - Rewrite WPT runner by [`@​lucacasonato](https://togithub.com/lucacasonato)` in [https://github.com/servo/rust-url/pull/857](https://togithub.com/servo/rust-url/pull/857) - Implement std::error::Error for InvalidBase64 by [`@​lucacasonato](https://togithub.com/lucacasonato)` in [https://github.com/servo/rust-url/pull/856](https://togithub.com/servo/rust-url/pull/856) - Add `--generate-link-to-definition` option when building on docs.rs by [`@​GuillaumeGomez](https://togithub.com/GuillaumeGomez)` in [https://github.com/servo/rust-url/pull/858](https://togithub.com/servo/rust-url/pull/858) - Stabilize debugger_visualizer feature by [`@​lucacasonato](https://togithub.com/lucacasonato)` in [https://github.com/servo/rust-url/pull/855](https://togithub.com/servo/rust-url/pull/855) - Update WPT data and expectations by [`@​lucacasonato](https://togithub.com/lucacasonato)` in [https://github.com/servo/rust-url/pull/859](https://togithub.com/servo/rust-url/pull/859) - Fix no_std Support for idna by [`@​domenukk](https://togithub.com/domenukk)` in [https://github.com/servo/rust-url/pull/843](https://togithub.com/servo/rust-url/pull/843) - Fix panic in set_path for file URLs by [`@​valenting](https://togithub.com/valenting)` in [https://github.com/servo/rust-url/pull/865](https://togithub.com/servo/rust-url/pull/865) #### New Contributors - [`@​mrobinson](https://togithub.com/mrobinson)` made their first contribution in [https://github.com/servo/rust-url/pull/851](https://togithub.com/servo/rust-url/pull/851) - [`@​GuillaumeGomez](https://togithub.com/GuillaumeGomez)` made their first contribution in [https://github.com/servo/rust-url/pull/858](https://togithub.com/servo/rust-url/pull/858) - [`@​domenukk](https://togithub.com/domenukk)` made their first contribution in [https://github.com/servo/rust-url/pull/843](https://togithub.com/servo/rust-url/pull/843) **Full Changelog**: servo/rust-url@v2.4.0...v2.4.1 ### [`v2.4.0`](https://togithub.com/servo/rust-url/releases/tag/v2.4.0) [Compare Source](https://togithub.com/servo/rust-url/compare/v2.3.1...v2.4.0) #### Crate version bump - data-url to 0.3.0 - percent-encoding to 2.3.0 - form_urlencoded to 1.2.0 - idna to 0.4.0 - url to 2.4.0 #### What's Changed - url: add the authority method by [`@​unleashed](https://togithub.com/unleashed)` in [https://github.com/servo/rust-url/pull/674](https://togithub.com/servo/rust-url/pull/674) - Fix clippy warnings by [`@​nickelc](https://togithub.com/nickelc)` in [https://github.com/servo/rust-url/pull/810](https://togithub.com/servo/rust-url/pull/810) - Replace unmaintained/outdated github actions by [`@​nickelc](https://togithub.com/nickelc)` in [https://github.com/servo/rust-url/pull/811](https://togithub.com/servo/rust-url/pull/811) - Implement potentially strip spaces for opaque paths by [`@​CYBAI](https://togithub.com/CYBAI)` in [https://github.com/servo/rust-url/pull/813](https://togithub.com/servo/rust-url/pull/813) - percent_encoding: faster percent_encode_byte by [`@​klensy](https://togithub.com/klensy)` in [https://github.com/servo/rust-url/pull/814](https://togithub.com/servo/rust-url/pull/814) - Update urltestdata.json WPT test cases by [`@​valenting](https://togithub.com/valenting)` in [https://github.com/servo/rust-url/pull/819](https://togithub.com/servo/rust-url/pull/819) - Fix anarchist URL where path starts with // by [`@​qsantos](https://togithub.com/qsantos)` in [https://github.com/servo/rust-url/pull/817](https://togithub.com/servo/rust-url/pull/817) - Avoid string allocation to get length of port by [`@​qsantos](https://togithub.com/qsantos)` in [https://github.com/servo/rust-url/pull/823](https://togithub.com/servo/rust-url/pull/823) - No colon when setting empty password by [`@​qsantos](https://togithub.com/qsantos)` in [https://github.com/servo/rust-url/pull/825](https://togithub.com/servo/rust-url/pull/825) - Url is special by [`@​qsantos](https://togithub.com/qsantos)` in [https://github.com/servo/rust-url/pull/826](https://togithub.com/servo/rust-url/pull/826) - Update msrv to 1.56 to keep up with serde-derive by [`@​valenting](https://togithub.com/valenting)` in [https://github.com/servo/rust-url/pull/827](https://togithub.com/servo/rust-url/pull/827) - `no_std` support for `form_urlencoded`, `data-url` and `idna` by [`@​madsmtm](https://togithub.com/madsmtm)` in [https://github.com/servo/rust-url/pull/722](https://togithub.com/servo/rust-url/pull/722) - Compile with serde feature on Rust playground and docs.rs by [`@​dtolnay](https://togithub.com/dtolnay)` in [https://github.com/servo/rust-url/pull/832](https://togithub.com/servo/rust-url/pull/832) - Fix issues with file drives by [`@​valenting](https://togithub.com/valenting)` in [https://github.com/servo/rust-url/pull/839](https://togithub.com/servo/rust-url/pull/839) - Update url to 2.4.0 and release new version by [`@​valenting](https://togithub.com/valenting)` in [https://github.com/servo/rust-url/pull/840](https://togithub.com/servo/rust-url/pull/840) #### New Contributors - [`@​nickelc](https://togithub.com/nickelc)` made their first contribution in [https://github.com/servo/rust-url/pull/810](https://togithub.com/servo/rust-url/pull/810) - [`@​CYBAI](https://togithub.com/CYBAI)` made their first contribution in [https://github.com/servo/rust-url/pull/813](https://togithub.com/servo/rust-url/pull/813) - [`@​klensy](https://togithub.com/klensy)` made their first contribution in [https://github.com/servo/rust-url/pull/814](https://togithub.com/servo/rust-url/pull/814) - [`@​qsantos](https://togithub.com/qsantos)` made their first contribution in [https://github.com/servo/rust-url/pull/817](https://togithub.com/servo/rust-url/pull/817) - [`@​madsmtm](https://togithub.com/madsmtm)` made their first contribution in [https://github.com/servo/rust-url/pull/722](https://togithub.com/servo/rust-url/pull/722) - [`@​dtolnay](https://togithub.com/dtolnay)` made their first contribution in [https://github.com/servo/rust-url/pull/832](https://togithub.com/servo/rust-url/pull/832) **Full Changelog**: servo/rust-url@v2.3.1...v2.4.0 ### [`v2.3.1`](https://togithub.com/servo/rust-url/compare/v2.3.0...v2.3.1) [Compare Source](https://togithub.com/servo/rust-url/compare/v2.3.0...v2.3.1) ### [`v2.3.0`](https://togithub.com/servo/rust-url/compare/v2.2.2...v2.3.0) [Compare Source](https://togithub.com/servo/rust-url/compare/v2.2.2...v2.3.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/jaysonsantos/aur-pkgbuild-updater). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi42OC4xIiwidXBkYXRlZEluVmVyIjoiMzYuNjguMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Following #817 (review), it was raise that
port.to_string().len()
could be optimized to avoid allocating a string.