From 9c80ad0f2e21bd82d071571db4e8a94a575146e5 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 11 Dec 2018 12:09:43 +0100 Subject: Add doc comment to pinentry::inquire_passphrase --- nitrocli/src/pinentry.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nitrocli/src/pinentry.rs b/nitrocli/src/pinentry.rs index 0553b8e..7bf1db9 100644 --- a/nitrocli/src/pinentry.rs +++ b/nitrocli/src/pinentry.rs @@ -83,6 +83,10 @@ fn parse_pinentry_passphrase(response: Vec) -> Result, Error> { } +/// Inquire a PIN of the given type from the user. +/// +/// This function inquires a PIN of the given type from the user or returns the cached passphrase, +/// if available. If an error message is set, it is displayed in the passphrase dialog. pub fn inquire_passphrase(pin_type: PinType, error_msg: Option<&str>) -> Result, Error> { let cache_id = pin_type.cache_id(); let error_msg = error_msg.map(|msg| msg.replace(" ", "+")).unwrap_or(String::from("+")); -- cgit v1.2.3