File tree Expand file tree Collapse file tree 3 files changed +56
-18
lines changed Expand file tree Collapse file tree 3 files changed +56
-18
lines changed Original file line number Diff line number Diff line change @@ -608,13 +608,22 @@ mod tests {
608
608
609
609
mod seek {
610
610
use chrono:: naive:: serde:: ts_microseconds;
611
- seek ! {
611
+ seek ! (
612
612
pub ( super ) enum Seek {
613
- Id { id: i32 } ,
614
- New { #[ serde( with="ts_microseconds" ) ] dt: chrono:: NaiveDateTime , id: i32 } ,
615
- RecentDownloads { downloads: Option <i64 >, id: i32 } ,
613
+ Id {
614
+ id: i32 ,
615
+ } ,
616
+ New {
617
+ #[ serde( with = "ts_microseconds" ) ]
618
+ dt: chrono:: NaiveDateTime ,
619
+ id: i32 ,
620
+ } ,
621
+ RecentDownloads {
622
+ downloads: Option <i64 >,
623
+ id: i32 ,
624
+ } ,
616
625
}
617
- }
626
+ ) ;
618
627
}
619
628
620
629
#[ test]
Original file line number Diff line number Diff line change @@ -558,17 +558,40 @@ mod seek {
558
558
use crate :: models:: Crate ;
559
559
use chrono:: naive:: serde:: ts_microseconds;
560
560
561
- seek ! {
561
+ seek ! (
562
562
pub enum Seek {
563
- Name { id: i32 } ,
564
- New { #[ serde( with="ts_microseconds" ) ] created_at: chrono:: NaiveDateTime , id: i32 } ,
565
- RecentUpdates { #[ serde( with="ts_microseconds" ) ] updated_at: chrono:: NaiveDateTime , id: i32 } ,
566
- RecentDownloads { recent_downloads: Option <i64 >, id: i32 } ,
567
- Downloads { downloads: i64 , id: i32 } ,
568
- Query { exact_match: bool , id: i32 } ,
569
- Relevance { exact_match: bool , rank: f32 , id: i32 } ,
563
+ Name {
564
+ id: i32 ,
565
+ } ,
566
+ New {
567
+ #[ serde( with = "ts_microseconds" ) ]
568
+ created_at: chrono:: NaiveDateTime ,
569
+ id: i32 ,
570
+ } ,
571
+ RecentUpdates {
572
+ #[ serde( with = "ts_microseconds" ) ]
573
+ updated_at: chrono:: NaiveDateTime ,
574
+ id: i32 ,
575
+ } ,
576
+ RecentDownloads {
577
+ recent_downloads: Option <i64 >,
578
+ id: i32 ,
579
+ } ,
580
+ Downloads {
581
+ downloads: i64 ,
582
+ id: i32 ,
583
+ } ,
584
+ Query {
585
+ exact_match: bool ,
586
+ id: i32 ,
587
+ } ,
588
+ Relevance {
589
+ exact_match: bool ,
590
+ rank: f32 ,
591
+ id: i32 ,
592
+ } ,
570
593
}
571
- }
594
+ ) ;
572
595
573
596
impl Seek {
574
597
pub ( crate ) fn to_payload (
Original file line number Diff line number Diff line change @@ -234,12 +234,18 @@ mod seek {
234
234
// We might consider refactoring this to use named fields, which would be clearer and more
235
235
// flexible. It's also worth noting that we currently encode seek compactly as a Vec, which
236
236
// doesn't include field names.
237
- seek ! {
237
+ seek ! (
238
238
pub enum Seek {
239
- Semver { id: i32 } ,
240
- Date { #[ serde( with="ts_microseconds" ) ] created_at: chrono:: NaiveDateTime , id: i32 } ,
239
+ Semver {
240
+ id: i32 ,
241
+ } ,
242
+ Date {
243
+ #[ serde( with = "ts_microseconds" ) ]
244
+ created_at: chrono:: NaiveDateTime ,
245
+ id: i32 ,
246
+ } ,
241
247
}
242
- }
248
+ ) ;
243
249
244
250
impl Seek {
245
251
pub ( crate ) fn to_payload ( & self , record : & ( Version , Option < User > ) ) -> SeekPayload {
You can’t perform that action at this time.
0 commit comments