Provide .method() and .query_params()

This commit is contained in:
Martin Algesten
2021-01-26 20:59:55 +01:00
parent c4c1618042
commit 239ba342a2
3 changed files with 88 additions and 46 deletions

View File

@@ -1,4 +1,4 @@
use url::Url;
use url::{ParseError, Url};
use std::error;
use std::fmt::{self, Display};
@@ -315,6 +315,14 @@ impl From<Transport> for Error {
}
}
impl From<ParseError> for Error {
fn from(err: ParseError) -> Self {
ErrorKind::InvalidUrl
.msg(&format!("failed to parse URL: {:?}", err))
.src(err)
}
}
impl fmt::Display for ErrorKind {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {