MCPcopy Create free account
hub / github.com/GCWing/BitFun / take_input

Method take_input

src/apps/cli/src/ui/text_input.rs:198–205  ·  view source on GitHub ↗

Take input text and reset state. Returns None if input is blank.

(&mut self)

Source from the content-addressed store, hash-verified

196
197 /// Take input text and reset state. Returns None if input is blank.
198 pub fn take_input(&mut self) -> Option<String> {
199 if self.input.trim().is_empty() {
200 return None;
201 }
202 let text = self.input.clone();
203 self.clear();
204 Some(text)
205 }
206
207 pub fn insert_paste(&mut self, text: &str) {
208 let normalized = text.replace("\r\n", "\n").replace('\r', "\n");

Callers 1

send_inputMethod · 0.80

Calls 4

trimMethod · 0.80
is_emptyMethod · 0.45
cloneMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected