Skip to content

Commit 84ffd68

Browse files
siddharthborderwalasoedirgo
authored andcommitted
make changes suggested by clippy
1 parent 3403743 commit 84ffd68

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/builder.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -426,17 +426,14 @@ impl<'a> Builder<'a> {
426426

427427
/// Executes the PostgREST request.
428428
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+
}
440437
match self.method {
441438
Method::GET | Method::HEAD => {}
442439
_ => {
@@ -448,7 +445,7 @@ impl<'a> Builder<'a> {
448445
.request(self.method, self.url)
449446
.headers(self.headers)
450447
.query(&self.queries)
451-
.body(self.body.unwrap_or("".to_string()))
448+
.body(self.body.unwrap_or_default())
452449
.send()
453450
.await
454451
}

0 commit comments

Comments
 (0)