use anyhow:Result

This commit is contained in:
weisd
2024-06-28 13:37:56 +08:00
parent a9e515e5c0
commit 4c7c3d4c96
10 changed files with 64 additions and 58 deletions
+2 -2
View File
@@ -3,11 +3,11 @@ use std::{
net::{IpAddr, ToSocketAddrs},
};
use anyhow::Error;
use anyhow::{Error, Result};
use netif;
use url::Host;
pub fn split_host_port(s: &str) -> Result<(String, u16), Error> {
pub fn split_host_port(s: &str) -> Result<(String, u16)> {
let parts: Vec<&str> = s.split(':').collect();
if parts.len() == 2 {
if let Ok(port) = parts[1].parse::<u16>() {