Skip to content

Commit

Permalink
hawkbit: simplify send_feedback_internal()
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Desmottes authored and gdesmott committed Jun 29, 2021
1 parent 557bb01 commit aea5878
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions hawkbit/src/ddi/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,10 @@ pub(crate) async fn send_feedback_internal<T: Serialize>(
) -> Result<(), Error> {
let mut url: Url = url.parse()?;
{
match url.path_segments_mut() {
Err(_) => {
return Err(Error::ParseUrlError(
url::ParseError::SetHostOnCannotBeABaseUrl,
))
}
Ok(mut paths) => {
paths.push("feedback");
}
}
let mut paths = url
.path_segments_mut()
.map_err(|_| url::ParseError::SetHostOnCannotBeABaseUrl)?;
paths.push("feedback");
}
url.set_query(None);

Expand Down

0 comments on commit aea5878

Please sign in to comment.