Simplify test code a bit, use Request::new() to simplfy constructing requests

This commit is contained in:
Barry Pederson
2024-11-03 12:49:23 -08:00
parent 4d70463e46
commit 60bc980e8d
4 changed files with 24 additions and 39 deletions
+6 -6
View File
@@ -9,12 +9,12 @@ fn main() -> std::io::Result<()> {
let mut stream = UnixStream::connect(&OPTIONS.socket_name)?;
println!("Connected to server");
let request = Request {
userid: OPTIONS.username.clone(),
password: OPTIONS.password.clone(),
service: "ignore-this".to_string(),
realm: "also-ignore-this".to_string(),
};
let request = Request::new(
&OPTIONS.username,
&OPTIONS.password,
"ignore-this",
"also-ignore-this",
);
request.write_to_stream(&mut stream)?;
let response = read_string(&mut stream)?;