Skip to content

Commit cdbab55

Browse files
committed
doc: copy-edit some doc comments in confirm.rs.
The comment of default() was misleading: if a default value is set, the user can still change the selected answer. They merely have the *additional* option of confirming the default choice.
1 parent 684a08a commit cdbab55

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/prompts/confirm.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ impl Confirm<'_> {
7878

7979
/// Set a default choice for the prompt.
8080
///
81-
/// Out of the box the prompt does not have a default and will continue
82-
/// to display until the user inputs something and hits enter. If a default is set the user
83-
/// can instead accept the default with enter.
81+
/// Out of the box, the prompt does not have a default choice and will continue
82+
/// to display until the user inputs something and hits enter. If a default is set,
83+
/// the user can also accept the default with enter.
8484
pub fn default(&mut self, val: bool) -> &mut Self {
8585
self.default = Some(val);
8686
self
@@ -98,8 +98,10 @@ impl Confirm<'_> {
9898
///
9999
/// The dialog is rendered on stderr.
100100
///
101-
/// Result contains `bool` if user answered "yes" or "no" or `default` (configured in [`default`](Self::default) if pushes enter.
102-
/// This unlike [`interact_opt`](Self::interact_opt) does not allow to quit with 'Esc' or 'q'.
101+
/// Result contains `bool` if the user answered "yes" or "no" or `default`
102+
/// (configured in [`default`](Self::default)) if they pushed enter.
103+
/// Unlike [`interact_opt`](Self::interact_opt), this does not allow
104+
/// to quit the dialog with 'Esc' or 'q'.
103105
#[inline]
104106
pub fn interact(&self) -> io::Result<bool> {
105107
self.interact_on(&Term::stderr())
@@ -109,8 +111,9 @@ impl Confirm<'_> {
109111
///
110112
/// The dialog is rendered on stderr.
111113
///
112-
/// Result contains `Some(bool)` if user answered "yes" or "no" or `Some(default)` (configured in [`default`](Self::default)) if pushes enter,
113-
/// or `None` if user cancelled with 'Esc' or 'q'.
114+
/// Result contains `Some(bool)` if the user answered "yes" or "no" or `Some(default)`
115+
/// (configured in [`default`](Self::default)) if they pushed enter,
116+
/// or `None` if the user cancelled the prompt with 'Esc' or 'q'.
114117
#[inline]
115118
pub fn interact_opt(&self) -> io::Result<Option<bool>> {
116119
self.interact_on_opt(&Term::stderr())

0 commit comments

Comments
 (0)