Skip to content

Use const_error! when possible#136844

Merged
bors merged 2 commits intorust-lang:masterfrom
thaliaarchi:const-io-error
Feb 17, 2025
Merged

Use const_error! when possible#136844
bors merged 2 commits intorust-lang:masterfrom
thaliaarchi:const-io-error

Conversation

@thaliaarchi
Copy link
Contributor

Replace usages of io::Error::new(io::ErrorKind::Variant, "constant string") with io::const_error!(io::ErrorKind::Variant, "constant string") to avoid allocations when possible. Additionally, fix &&str error messages in SGX and missing/misplaced trailing commas in const_error!.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-hermit Operating System: Hermit O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-windows Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants