Skip to content

Commit 4d6a5b1

Browse files
committed
Update nickname generic in launch_onion_service func
1 parent 27d3a55 commit 4d6a5b1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/native/tor.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
66
use std::net::SocketAddr;
77
use std::path::PathBuf;
8-
use std::str::FromStr;
98
use std::sync::Arc;
109

1110
use arti_client::config::onion_service::OnionServiceConfigBuilder;
@@ -96,7 +95,7 @@ pub async fn launch_onion_service<S>(
9695
custom_path: Option<PathBuf>,
9796
) -> Result<Arc<RunningOnionService>, Error>
9897
where
99-
S: AsRef<str>,
98+
S: Into<String>,
10099
{
101100
// Get tor client
102101
let client: &TorClient<PreferredRuntime> = get_tor_client(custom_path).await?;
@@ -109,7 +108,7 @@ where
109108
config.set_proxy_ports(vec![ProxyRule::new(pattern, action)]);
110109
let proxy = OnionServiceReverseProxy::new(config.build()?);
111110

112-
let nickname: HsNickname = HsNickname::from_str(nickname.as_ref())?;
111+
let nickname: HsNickname = HsNickname::new(nickname.into())?;
113112
let config: OnionServiceConfig = OnionServiceConfigBuilder::default()
114113
.nickname(nickname.clone())
115114
.build()?;

0 commit comments

Comments
 (0)