22 lines
624 B
Rust
22 lines
624 B
Rust
|
|
// Libraries
|
||
|
|
use std::io;
|
||
|
|
|
||
|
|
// Functions
|
||
|
|
pub fn int_auth() -> (String, String) {
|
||
|
|
// Variables
|
||
|
|
let mut username: String = String::new();
|
||
|
|
let mut password: String = String::new();
|
||
|
|
|
||
|
|
// Asking for the username
|
||
|
|
println!(" - LOGIN - ");
|
||
|
|
println!("Username: ");
|
||
|
|
io::stdin().read_line(&mut username).expect("Failed to read line");
|
||
|
|
username = String::from(username.to_lowercase().trim());
|
||
|
|
|
||
|
|
// Asking for the password
|
||
|
|
println!("Password: ");
|
||
|
|
io::stdin().read_line(&mut password).expect("Failed to read line");
|
||
|
|
password = String::from(password.trim());
|
||
|
|
|
||
|
|
return (username, password);
|
||
|
|
}
|