@@ -432,15 +432,15 @@ async fn get(
432
432
let full_time_range = req. time_range . end - req. time_range . start ;
433
433
if full_time_range < TimeDelta :: zero ( ) {
434
434
return Err ( ApiError :: InvalidInput (
435
- "end date must be after start date" . into ( ) ,
435
+ "End date must be after start date" . into ( ) ,
436
436
) ) ;
437
437
}
438
438
439
439
let ( num_time_slices, resolution) = match req. time_range . resolution {
440
440
TimeRangeResolution :: Slices ( slices) => {
441
441
let slices = i32:: try_from ( slices. get ( ) ) . map_err ( |_| {
442
442
ApiError :: InvalidInput (
443
- "number of slices must fit into an `i32`" . into ( ) ,
443
+ "Number of slices must fit into an `i32`" . into ( ) ,
444
444
)
445
445
} ) ?;
446
446
let resolution = full_time_range / slices;
@@ -450,12 +450,12 @@ async fn get(
450
450
let resolution_minutes = i64:: try_from ( resolution_minutes. get ( ) )
451
451
. map_err ( |_| {
452
452
ApiError :: InvalidInput (
453
- "resolution must fit into a `u64 `" . into ( ) ,
453
+ "Resolution must fit into a `i64 `" . into ( ) ,
454
454
)
455
455
} ) ?;
456
456
let resolution = TimeDelta :: try_minutes ( resolution_minutes)
457
457
. ok_or_else ( || {
458
- ApiError :: InvalidInput ( "resolution overflow" . into ( ) )
458
+ ApiError :: InvalidInput ( "Resolution overflow" . into ( ) )
459
459
} ) ?;
460
460
461
461
let num_slices =
@@ -467,12 +467,12 @@ async fn get(
467
467
468
468
if num_time_slices > MAX_TIME_SLICES {
469
469
return Err ( ApiError :: InvalidInput ( format ! (
470
- "resolution is too fine or range is too large - maximum of {MAX_TIME_SLICES} time slices, was {num_time_slices}"
470
+ "Resolution is too fine or range is too large - maximum of {MAX_TIME_SLICES} time slices, was {num_time_slices}"
471
471
) ) ) ;
472
472
}
473
473
if resolution < MIN_RESOLUTION {
474
474
return Err ( ApiError :: InvalidInput ( format ! (
475
- "resolution must be at least {MIN_RESOLUTION}, was {resolution}" ,
475
+ "Resolution must be at least {MIN_RESOLUTION}, was {resolution}" ,
476
476
) ) ) ;
477
477
}
478
478
0 commit comments