misc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.alexwennerberg.com/misc
Log | Files | Refs | README | LICENSE

commit d629a90b3c575ed4ad70fb700a315dd4dbc69093
parent 4ec4536708ffb373e502e4424e9450af2cec46f4
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun, 24 Oct 2021 14:24:18 -0700

Rustfmt finger

Diffstat:
Mfinger.rs | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/finger.rs b/finger.rs @@ -13,11 +13,11 @@ // The finger protocol is featured heavily in Elif Batuman's Pulitizer Prize nominated novel The Idiot. // FINGER > FACEBOOK +use std::env; +use std::io; use std::io::prelude::*; use std::net::TcpStream; -use std::env; use std::process; -use std::io; fn main() -> std::io::Result<()> { let args: Vec<String> = env::args().collect(); @@ -33,15 +33,16 @@ fn main() -> std::io::Result<()> { user = ""; } else { user = params[0]; - if params.len() > 2 || !user.chars().all(|c| c.is_ascii()) { + if params.len() > 2 || !user.chars().all(|c| c.is_ascii()) { println!("Username must be ascii and not include @"); process::exit(1); } host = params[1]; } - let mut stream = TcpStream::connect(format!("{}:79", host)).expect("Couldn't connect to the server."); + let mut stream = + TcpStream::connect(format!("{}:79", host)).expect("Couldn't connect to the server."); - // Only supports queries of type Q1 + // Only supports queries of type Q1 // https://datatracker.ietf.org/doc/html/rfc1288#section-2.3 // Doesn't support long mode (/W) -- most servers online don't stream.write(user.as_bytes())?;