feat: find kid first arg
This commit is contained in:
@@ -270,13 +270,9 @@ fn read_slot(config: &Option<TinyEncryptConfig>, kid: &str, slot: &Option<String
|
||||
Some(slot) => Ok(slot.to_string()),
|
||||
None => {
|
||||
if let Some(config) = config {
|
||||
if let Some(e) = config.find_by_kid(kid) {
|
||||
if let Some(args) = &e.args {
|
||||
if let Some(first_arg) = args.iter().next() {
|
||||
information!("Found kid: {}'s slot: {}", kid, first_arg);
|
||||
return Ok(first_arg.to_string());
|
||||
}
|
||||
}
|
||||
if let Some(first_arg) = config.find_first_arg_by_kid(kid) {
|
||||
information!("Found kid: {}'s slot: {}", kid, first_arg);
|
||||
return Ok(first_arg.to_string());
|
||||
}
|
||||
}
|
||||
print!("Input slot(eg 82, 83 ...): ");
|
||||
|
||||
Reference in New Issue
Block a user