Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmorley committed Apr 15, 2022
1 parent 8770ea0 commit fc3dcf0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 36 deletions.
32 changes: 0 additions & 32 deletions .github/dependabot.yml

This file was deleted.

11 changes: 8 additions & 3 deletions src/config/organization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use crate::select_opt;

use std::collections::HashMap;
use std::convert::TryFrom;
use std::fmt;
use std::fs::read_to_string;
use std::path::Path;
use std::str::FromStr;
use std::{fmt, io};

use anyhow::{anyhow, Error, Result};
use aws_types::Credentials;
Expand Down Expand Up @@ -128,15 +128,20 @@ impl TryFrom<&Path> for Organization {
}
}

pub fn prompt_username(organization: &impl fmt::Display) -> Result<String, Error> {
/// Prompt for a username for a given Okta organization.
///
/// # Errors
///
/// Will return `Err` if there are any IO errors during the prompt
pub fn prompt_username(organization: &impl fmt::Display) -> Result<String, io::Error> {
let mut input = Input::<String>::new();
input.with_prompt(&format!("Username for {}", organization));

if let Ok(system_user) = username::get_user_name() {
input.default(system_user);
}

input.interact_text().map_err(Into::into)
input.interact_text()
}

impl Organization {
Expand Down
2 changes: 1 addition & 1 deletion src/config/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl Profile {
Config::Name(_) => None,
Config::Detailed {
duration_seconds, ..
} => duration_seconds.clone(),
} => *duration_seconds,
}
.or(default_duration_seconds),
})
Expand Down

0 comments on commit fc3dcf0

Please sign in to comment.