@@ -57,7 +57,7 @@ impl<'a> Select<'a> {
57
57
/// Creates a select prompt builder with a specific theme.
58
58
///
59
59
/// ## Examples
60
- ///```rust,no_run
60
+ /// ```rust,no_run
61
61
/// use dialoguer::{
62
62
/// Select,
63
63
/// theme::ColorfulTheme
@@ -71,7 +71,7 @@ impl<'a> Select<'a> {
71
71
///
72
72
/// Ok(())
73
73
/// }
74
- ///```
74
+ /// ```
75
75
pub fn with_theme ( theme : & ' a dyn Theme ) -> Select < ' a > {
76
76
Select {
77
77
default : !0 ,
@@ -114,7 +114,7 @@ impl<'a> Select<'a> {
114
114
/// use dialoguer::Select;
115
115
///
116
116
/// fn main() -> std::io::Result<()> {
117
- /// let selection : usize = Select::new()
117
+ /// let selection: usize = Select::new()
118
118
/// .item("Item 1")
119
119
/// .item("Item 2")
120
120
/// .interact()?;
@@ -135,11 +135,11 @@ impl<'a> Select<'a> {
135
135
///
136
136
/// fn main() -> std::io::Result<()> {
137
137
/// let items = vec!["Item 1", "Item 2"];
138
- /// let selection2 : usize = Select::new()
138
+ /// let selection : usize = Select::new()
139
139
/// .items(&items)
140
140
/// .interact()?;
141
141
///
142
- /// println!("{}", items[selection2 ]);
142
+ /// println!("{}", items[selection ]);
143
143
///
144
144
/// Ok(())
145
145
/// }
@@ -176,18 +176,18 @@ impl<'a> Select<'a> {
176
176
}
177
177
178
178
/// Enables user interaction and returns the result.
179
+ ///
179
180
/// Similar to [interact_on](#method.interact_on) except for the fact that it does not allow selection of the terminal.
180
181
/// The dialog is rendered on stderr.
181
- ///
182
182
/// Result contains index of a selected item.
183
183
pub fn interact ( & self ) -> io:: Result < usize > {
184
184
self . interact_on ( & Term :: stderr ( ) )
185
185
}
186
186
187
- /// Enables user interaction and returns the result.
187
+ /// Enables user interaction and returns the result.
188
+ ///
188
189
/// 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.
189
190
/// The dialog is rendered on stderr.
190
- ///
191
191
/// Result contains `Some(index)` if user selected one of items or `None` if user cancelled with 'Esc' or 'q'.
192
192
pub fn interact_opt ( & self ) -> io:: Result < Option < usize > > {
193
193
self . interact_on_opt ( & Term :: stderr ( ) )
0 commit comments