Skip to content

Commit

Permalink
fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
Covertness committed Jan 23, 2021
1 parent f456737 commit 4d13d3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client.rs
Expand Up @@ -115,14 +115,14 @@ impl CoAPClient {
/// Execute a single request (GET, POST, PUT, DELETE) with a coap url
pub fn request(url: &str, method: Method, data: Option<Vec<u8>>) -> Result<CoapResponse> {
let (domain, port, path) = Self::parse_coap_url(url)?;
let client = Self::new((domain, port))?;
let client = Self::new((domain.as_str(), port))?;
client.request_path(&path, method, data)
}

/// Execute a single request (GET, POST, PUT, DELETE) with a coap url and a specfic timeout
pub fn request_with_timeout(url: &str, method: Method, data: Option<Vec<u8>>, timeout: Duration) -> Result<CoapResponse> {
let (domain, port, path) = Self::parse_coap_url(url)?;
let client = Self::new((domain, port))?;
let client = Self::new((domain.as_str(), port))?;
client.request_path_with_timeout(&path, method, data, timeout)
}

Expand Down

0 comments on commit 4d13d3a

Please sign in to comment.