Skip to content

Commit 13a2153

Browse files
committed
doc: Document members of the Confirm struct.
1 parent cdbab55 commit 13a2153

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/prompts/confirm.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@ use console::{Key, Term};
2020
/// # Ok(()) } fn main() { test().unwrap(); }
2121
/// ```
2222
pub struct Confirm<'a> {
23+
/// Message of the confirmation prompt.
2324
prompt: String,
25+
/// Whether to report the user's choice after selection.
2426
report: bool,
27+
/// default option for the prompt (if any)
2528
default: Option<bool>,
29+
/// if true, show the default value to the user, see [`show_default`](#method::show_default)
2630
show_default: bool,
31+
/// when to react to user input, see [`wait_for_newline`](#methhod::wait_for_newline)
2732
wait_for_newline: bool,
2833
theme: &'a dyn Theme,
2934
}

src/theme.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ pub trait Theme {
1818
}
1919

2020
/// Format a confirmation prompt.
21+
///
22+
/// `prompt` is the message of the confirmation prompt,
23+
/// `default` is the default choice for the prompt (if any).
2124
fn format_confirm_prompt(
2225
&self,
2326
f: &mut dyn fmt::Write,

0 commit comments

Comments
 (0)