File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -426,17 +426,14 @@ impl<'a> Builder<'a> {
426
426
427
427
/// Executes the PostgREST request.
428
428
pub async fn execute ( mut self ) -> Result < Response , Error > {
429
- match self . schema {
430
- Some ( schema) => {
431
- let key = match self . method {
432
- Method :: GET | Method :: HEAD => "Accept-Profile" ,
433
- _ => "Content-Profile" ,
434
- } ;
435
- self . headers
436
- . insert ( key, HeaderValue :: from_str ( & schema) . unwrap ( ) ) ;
437
- }
438
- None => { }
439
- } ;
429
+ if let Some ( schema) = self . schema {
430
+ let key = match self . method {
431
+ Method :: GET | Method :: HEAD => "Accept-Profile" ,
432
+ _ => "Content-Profile" ,
433
+ } ;
434
+ self . headers
435
+ . insert ( key, HeaderValue :: from_str ( & schema) . unwrap ( ) ) ;
436
+ }
440
437
match self . method {
441
438
Method :: GET | Method :: HEAD => { }
442
439
_ => {
@@ -448,7 +445,7 @@ impl<'a> Builder<'a> {
448
445
. request ( self . method , self . url )
449
446
. headers ( self . headers )
450
447
. query ( & self . queries )
451
- . body ( self . body . unwrap_or ( "" . to_string ( ) ) )
448
+ . body ( self . body . unwrap_or_default ( ) )
452
449
. send ( )
453
450
. await
454
451
}
You can’t perform that action at this time.
0 commit comments