fixing newline issue
This commit is contained in:
17
src/main.rs
17
src/main.rs
@@ -27,17 +27,16 @@ async fn main() {
|
|||||||
let mut location_id: u32 = CHARLOTTE;
|
let mut location_id: u32 = CHARLOTTE;
|
||||||
let mut buf = [0, 0, 0, 0];
|
let mut buf = [0, 0, 0, 0];
|
||||||
|
|
||||||
println!("Enter a location id to override the default (Charlotte, NC): ");
|
println!(
|
||||||
let loc_input = io::stdin().read(&mut buf).await;
|
"Enter a location id to override the default (Charlotte, NC, {:?}): ",
|
||||||
|
CHARLOTTE
|
||||||
|
);
|
||||||
|
io::stdin().read(&mut buf).await.unwrap();
|
||||||
|
|
||||||
if loc_input.unwrap() > 1 {
|
let loc = String::from_utf8(buf.to_vec()).unwrap().trim().parse();
|
||||||
location_id = String::from_utf8(buf.to_vec())
|
if loc.is_ok() {
|
||||||
.unwrap()
|
location_id = loc.unwrap();
|
||||||
.trim()
|
|
||||||
.parse()
|
|
||||||
.unwrap();
|
|
||||||
}
|
}
|
||||||
eprintln!("Using default location (Charlotte, NC): {}", location_id);
|
|
||||||
|
|
||||||
println!("Looking for appointments at location id: {}", location_id);
|
println!("Looking for appointments at location id: {}", location_id);
|
||||||
loop {
|
loop {
|
||||||
|
|||||||
Reference in New Issue
Block a user