aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/login.rs
diff options
context:
space:
mode:
authorConrad Ludgate <conrad.ludgate@truelayer.com>2022-04-12 23:06:19 +0100
committerGitHub <noreply@github.com>2022-04-12 23:06:19 +0100
commita95018cc9039851e707973bc19faf907132ae4f3 (patch)
treee135f1da64c5d020f336d437f83a333298861ca0 /src/command/login.rs
parentfix env config parsing (#295) (diff)
downloadatuin-a95018cc9039851e707973bc19faf907132ae4f3.zip
goodbye warp, hello axum (#296)
Diffstat (limited to 'src/command/login.rs')
-rw-r--r--src/command/login.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/command/login.rs b/src/command/login.rs
index fe442bc1..efc9c590 100644
--- a/src/command/login.rs
+++ b/src/command/login.rs
@@ -1,4 +1,3 @@
-use std::borrow::Cow;
use std::io;
use atuin_common::api::LoginRequest;
@@ -66,10 +65,8 @@ impl Cmd {
}
}
-pub(super) fn or_user_input<'a>(value: &'a Option<String>, name: &'static str) -> Cow<'a, str> {
- value
- .as_deref()
- .map_or_else(|| Cow::Owned(read_user_input(name)), Cow::Borrowed)
+pub(super) fn or_user_input(value: &'_ Option<String>, name: &'static str) -> String {
+ value.clone().unwrap_or_else(|| read_user_input(name))
}
fn read_user_input(name: &'static str) -> String {