M Cargo.lock => Cargo.lock +1 -1
@@ 112,7 112,7 @@ dependencies = [
[[package]]
name = "castor"
-version = "0.8.7"
+version = "0.8.8"
dependencies = [
"ansi-parser",
"dirs",
M Cargo.toml => Cargo.toml +1 -1
@@ 1,6 1,6 @@
[package]
name = "castor"
-version = "0.8.7"
+version = "0.8.8"
authors = ["Julien Blanchard <julien@typed-hole.org>"]
edition = "2018"
M src/finger/client.rs => src/finger/client.rs +2 -1
@@ 8,7 8,8 @@ use crate::Protocol;
pub fn get_data<T: Protocol>(url: T) -> Result<(Option<Vec<u8>>, Vec<u8>), String> {
let url = url.get_source_url();
let host = url.host_str().unwrap().to_string();
- let urlf = format!("{}:79", host);
+ let port = url.port().unwrap_or(79);
+ let urlf = format!("{}:{}", host, port);
match urlf.to_socket_addrs() {
Ok(mut addrs_iter) => match addrs_iter.next() {
M src/gemini/client.rs => src/gemini/client.rs +2 -1
@@ 9,7 9,8 @@ use crate::protocols::*;
pub fn get_data<T: Protocol>(url: T) -> Result<(Option<Vec<u8>>, Vec<u8>), String> {
let url = url.get_source_url();
let host = url.host_str().unwrap();
- let urlf = format!("{}:1965", host);
+ let port = url.port().unwrap_or(1965);
+ let urlf = format!("{}:{}", host, port);
let mut builder = TlsConnector::builder();
builder.danger_accept_invalid_hostnames(true);
M src/gopher/client.rs => src/gopher/client.rs +1 -4
@@ 9,10 9,7 @@ use crate::Protocol;
pub fn get_data<T: Protocol>(url: T) -> Result<(Option<Vec<u8>>, Vec<u8>), String> {
let url = url.get_source_url();
let host = url.host_str().unwrap().to_string();
- let port = match url.port() {
- Some(port) => port,
- None => 70,
- };
+ let port = url.port().unwrap_or(70);
let urlf = format!("{}:{}", host, port);
match urlf.to_socket_addrs() {