~shockham/gemo

5ca1d4e10f37ed60d3a51939d221046814e45de6 — shockham 3 years ago 0a9c440
rustfmt
1 files changed, 3 insertions(+), 6 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +3 -6
@@ 6,11 6,9 @@ fn client() -> Result<String, String> {
    let mut builder = TlsConnector::builder();
    builder.danger_accept_invalid_hostnames(true);
    builder.danger_accept_invalid_certs(true);
    let connector = builder.build()
        .expect("Connection Failed");
    let connector = builder.build().expect("Connection Failed");

    let stream = TcpStream::connect("gemini.circumlunar.space:1965")
        .expect("Connection Failed");
    let stream = TcpStream::connect("gemini.circumlunar.space:1965").expect("Connection Failed");
    let mut stream = connector
        .connect("gemini.circumlunar.space", stream)
        .expect("Connection Failed");


@@ 19,8 17,7 @@ fn client() -> Result<String, String> {
        .write_all(b"gemini://gemini.circumlunar.space/users/hundredrabbits/\r\n")
        .expect("Connection Failed");
    let mut res = vec![];
    stream.read_to_end(&mut res)
        .expect("Connection Failed");
    stream.read_to_end(&mut res).expect("Connection Failed");

    Ok(String::from_utf8_lossy(&res).to_string())
}