Skip to content

Commit e8b97bc

Browse files
authored
Apply suggestions from code review
1 parent 3801f31 commit e8b97bc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/prompts/select.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl<'a> Select<'a> {
5757
/// Creates a select prompt builder with a specific theme.
5858
///
5959
/// ## Examples
60-
///```rust,no_run
60+
/// ```rust,no_run
6161
/// use dialoguer::{
6262
/// Select,
6363
/// theme::ColorfulTheme
@@ -71,7 +71,7 @@ impl<'a> Select<'a> {
7171
///
7272
/// Ok(())
7373
/// }
74-
///```
74+
/// ```
7575
pub fn with_theme(theme: &'a dyn Theme) -> Select<'a> {
7676
Select {
7777
default: !0,
@@ -114,7 +114,7 @@ impl<'a> Select<'a> {
114114
/// use dialoguer::Select;
115115
///
116116
/// fn main() -> std::io::Result<()> {
117-
/// let selection : usize = Select::new()
117+
/// let selection: usize = Select::new()
118118
/// .item("Item 1")
119119
/// .item("Item 2")
120120
/// .interact()?;
@@ -135,11 +135,11 @@ impl<'a> Select<'a> {
135135
///
136136
/// fn main() -> std::io::Result<()> {
137137
/// let items = vec!["Item 1", "Item 2"];
138-
/// let selection2 : usize = Select::new()
138+
/// let selection: usize = Select::new()
139139
/// .items(&items)
140140
/// .interact()?;
141141
///
142-
/// println!("{}", items[selection2]);
142+
/// println!("{}", items[selection]);
143143
///
144144
/// Ok(())
145145
/// }
@@ -176,18 +176,18 @@ impl<'a> Select<'a> {
176176
}
177177

178178
/// Enables user interaction and returns the result.
179+
///
179180
/// Similar to [interact_on](#method.interact_on) except for the fact that it does not allow selection of the terminal.
180181
/// The dialog is rendered on stderr.
181-
///
182182
/// Result contains index of a selected item.
183183
pub fn interact(&self) -> io::Result<usize> {
184184
self.interact_on(&Term::stderr())
185185
}
186186

187-
/// Enables user interaction and returns the result.
187+
/// Enables user interaction and returns the result.
188+
///
188189
/// This method is similar to [interact_on_opt](#method.interact_on_opt) except for the fact that it does not allow selection of the terminal.
189190
/// The dialog is rendered on stderr.
190-
///
191191
/// Result contains `Some(index)` if user selected one of items or `None` if user cancelled with 'Esc' or 'q'.
192192
pub fn interact_opt(&self) -> io::Result<Option<usize>> {
193193
self.interact_on_opt(&Term::stderr())

0 commit comments

Comments
 (0)