diff options
author | Bert Belder <bertbelder@gmail.com> | 2020-08-26 00:22:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 00:22:15 +0200 |
commit | 9bfb0df805719cb3f022a5b5d9f9d898ae954c2e (patch) | |
tree | 6c7d62d95fcbde54ebbe1035bdc74618c63cfbc0 /cli/resolve_addr.rs | |
parent | d0ccab7fb7dd80030d3765ca9a9af44de6ecda5a (diff) |
refactor: remove OpError, use ErrBox everywhere (#7187)
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/resolve_addr.rs')
-rw-r--r-- | cli/resolve_addr.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/resolve_addr.rs b/cli/resolve_addr.rs index 3081ef431..a25bf7454 100644 --- a/cli/resolve_addr.rs +++ b/cli/resolve_addr.rs @@ -1,10 +1,10 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -use crate::op_error::OpError; +use deno_core::ErrBox; use std::net::SocketAddr; use std::net::ToSocketAddrs; /// Resolve network address. Returns a future. -pub fn resolve_addr(hostname: &str, port: u16) -> Result<SocketAddr, OpError> { +pub fn resolve_addr(hostname: &str, port: u16) -> Result<SocketAddr, ErrBox> { // Default to localhost if given just the port. Example: ":80" let addr: &str = if !hostname.is_empty() { &hostname @@ -21,7 +21,7 @@ pub fn resolve_addr(hostname: &str, port: u16) -> Result<SocketAddr, OpError> { addr }; let addr_port_pair = (addr, port); - let mut iter = addr_port_pair.to_socket_addrs().map_err(OpError::from)?; + let mut iter = addr_port_pair.to_socket_addrs()?; Ok(iter.next().unwrap()) } |