diff --git a/Cargo.toml b/Cargo.toml index 133dad7..7fa380b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,4 +4,4 @@ version = "0.1.0" edition = "2021" [dependencies] -native-tls = "0.2" +native-tls = { version = "0.2", features = ["vendored"] } diff --git a/src/main.rs b/src/main.rs index e7a11a9..f39eee9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,13 @@ +mod tls; fn main() { println!("Hello, world!"); + tls::main(); +} + +#[cfg(test)] +mod tests { + #[test] + fn passes() { + println!("passes okay"); + } } diff --git a/examples/native-tls.rs b/src/tls.rs similarity index 96% rename from examples/native-tls.rs rename to src/tls.rs index 32acc40..f4cb49c 100644 --- a/examples/native-tls.rs +++ b/src/tls.rs @@ -2,7 +2,7 @@ use native_tls::TlsConnector; use std::io::{Read, Write}; use std::net::TcpStream; -fn main() { +pub fn main() { let connector = TlsConnector::new().unwrap(); let stream = TcpStream::connect("google.com:443").unwrap();