style: 格式化代码并优化导入顺序
This commit is contained in:
@@ -32,10 +32,10 @@ pub fn print_info(msg: &str) {
|
||||
pub fn confirm(prompt: &str) -> Result<bool> {
|
||||
print!("{} [y/N] ", prompt);
|
||||
io::stdout().flush()?;
|
||||
|
||||
|
||||
let mut input = String::new();
|
||||
io::stdin().read_line(&mut input)?;
|
||||
|
||||
|
||||
Ok(input.trim().to_lowercase().starts_with('y'))
|
||||
}
|
||||
|
||||
@@ -43,17 +43,17 @@ pub fn confirm(prompt: &str) -> Result<bool> {
|
||||
pub fn input(prompt: &str) -> Result<String> {
|
||||
print!("{}: ", prompt);
|
||||
io::stdout().flush()?;
|
||||
|
||||
|
||||
let mut input = String::new();
|
||||
io::stdin().read_line(&mut input)?;
|
||||
|
||||
|
||||
Ok(input.trim().to_string())
|
||||
}
|
||||
|
||||
/// Get password input (hidden)
|
||||
pub fn password_input(prompt: &str) -> Result<String> {
|
||||
use dialoguer::Password;
|
||||
|
||||
|
||||
Password::new()
|
||||
.with_prompt(prompt)
|
||||
.interact()
|
||||
|
||||
Reference in New Issue
Block a user