Skip to content

Conversation

@davidhewitt
Copy link
Contributor

Change Summary

Fix lints for Rust 1.86

NB use of the write!(string, ...) macro instead of string.push_str(&format!(...)) is recommended by clippy because it's more efficient (avoids an intermediate allocation in the format!() call), and should be infallible just like push_str but we have to handle the results because other possible targets for write!() (like IO streams) might fail.

Because it should never fail, I chose to just .expect() these.

Related issue number

N/A

Checklist

  • Unit tests for the changes exist
  • Documentation reflects the changes where applicable
  • Pydantic tests pass with this pydantic-core (except for expected changes)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@davidhewitt davidhewitt requested a review from Viicos April 3, 2025 14:29
@davidhewitt davidhewitt enabled auto-merge (squash) April 3, 2025 14:32
@davidhewitt davidhewitt merged commit ee8c173 into main Apr 3, 2025
28 checks passed
@davidhewitt davidhewitt deleted the dh/rust-1.86 branch April 3, 2025 14:35
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 3, 2025

CodSpeed Performance Report

Merging #1682 will not alter performance

Comparing dh/rust-1.86 (9f90c3a) with main (baa8cbf)

Summary

✅ 157 untouched benchmarks

davidhewitt added a commit to pydantic/pydantic that referenced this pull request Oct 20, 2025
davidhewitt added a commit to pydantic/pydantic that referenced this pull request Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants