-
Notifications
You must be signed in to change notification settings - Fork 628
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
Convert seek to named fields #8260
Conversation
0433043
to
9f57dd4
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8260 +/- ##
==========================================
+ Coverage 87.75% 87.78% +0.03%
==========================================
Files 273 273
Lines 27372 27460 +88
==========================================
+ Hits 24019 24107 +88
Misses 3353 3353 ☔ View full report in Codecov by Sentry. |
e65ebc9
to
636002e
Compare
636002e
to
526e785
Compare
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.
I'm definitely not smart enough to review the new implementation of the seek
macro, but it seems to work just fine, and I definitely prefer the new code that uses it.
👍 from me as long as we get the formatting fixed up in the actual uses of seek!
. Nice job!
Id{id: i32} | ||
New{#[serde(with="ts_microseconds")] dt: chrono::NaiveDateTime, id: i32} | ||
RecentDownloads{ downloads: Option<i64>, id: i32 } |
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.
This could use some manual formatting, since rustfmt
obviously isn't getting in here.
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.
I've managed to figure out how to rustfmt
can be used for this:
- we need to have valid Rust code inside the macro invocation, but the implementation was missing trailing commas for the enum variants
- it needs to be invoked as
seek!(...);
instead ofseek! { ... }
and apparently that enables rustfmt to format the invocation content (see https://users.rust-lang.org/t/rustfmt-skips-macro-arguments/74807/4)
I've added two commits to the PR for the above.
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 for your help. I appreciate it.
let ( | ||
Crate { | ||
id, | ||
updated_at, | ||
created_at, | ||
.. | ||
}, | ||
exact_match, | ||
downloads, | ||
recent_downloads, | ||
rank, | ||
) = *record; |
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.
Some day I hope to be brave enough to write a let
destructure like this. 😆
4dbde8c
to
03eb6fd
Compare
As mention in commits #8244 (comment) and #8037 (comment).
This PR is best reviewed commit-by-commit.