@@ -2,24 +2,21 @@ macro_rules! fn_eq_resource_id {
22 ( $table: ident, $resource_id: ident) => {
33 pub fn eq_resource_id(
44 resource_id: & bencher_json:: $resource_id,
5- ) -> Result <
6- Box <
7- dyn diesel:: BoxableExpression <
8- $crate:: schema:: $table:: table,
9- diesel:: sqlite:: Sqlite ,
10- SqlType = diesel:: sql_types:: Bool ,
11- >,
12- >,
13- dropshot:: HttpError ,
5+ ) -> Box <
6+ dyn diesel:: BoxableExpression <
7+ $crate:: schema:: $table:: table,
8+ diesel:: sqlite:: Sqlite ,
9+ SqlType = diesel:: sql_types:: Bool ,
10+ >,
1411 > {
15- Ok ( match resource_id {
12+ match resource_id {
1613 bencher_json:: ResourceId :: Uuid ( uuid) => {
1714 Box :: new( $crate:: schema:: $table:: uuid. eq( uuid. to_string( ) ) )
1815 } ,
1916 bencher_json:: ResourceId :: Slug ( slug) => {
2017 Box :: new( $crate:: schema:: $table:: slug. eq( slug. to_string( ) ) )
2118 } ,
22- } )
19+ }
2320 }
2421 } ;
2522}
@@ -35,7 +32,7 @@ macro_rules! fn_from_resource_id {
3532 ) -> Result <Self , HttpError > {
3633 schema:: $table:: table
3734 . filter( schema:: $table:: $parent. eq( parent) )
38- . filter( Self :: eq_resource_id( resource_id) ? )
35+ . filter( Self :: eq_resource_id( resource_id) )
3936 . first:: <Self >( conn)
4037 . map_err( $crate:: error:: resource_not_found_err!(
4138 $resource,
@@ -49,7 +46,7 @@ macro_rules! fn_from_resource_id {
4946 resource_id: & bencher_json:: $resource_id,
5047 ) -> Result <Self , HttpError > {
5148 schema:: $table:: table
52- . filter( Self :: eq_resource_id( resource_id) ? )
49+ . filter( Self :: eq_resource_id( resource_id) )
5350 . first:: <Self >( conn)
5451 . map_err( $crate:: error:: resource_not_found_err!(
5552 $resource,
0 commit comments