MCPcopy Index your code
hub / github.com/endbasic/endbasic / finish

Method finish

std/src/console/readline.rs:326–336  ·  view source on GitHub ↗

Finalizes history bookkeeping and returns the edited line.

(mut self)

Source from the content-addressed store, hash-verified

324
325 /// Finalizes history bookkeeping and returns the edited line.
326 fn finish(mut self) -> String {
327 if let Some(history) = self.history.as_mut() {
328 if self.line.is_empty() {
329 history.pop();
330 } else {
331 let last = history.len() - 1;
332 history[last] = self.line.to_string();
333 }
334 }
335 self.line.into_inner()
336 }
337
338 /// Creates a new interactive line editor and renders its initial state.
339 fn new(

Callers 1

runMethod · 0.45

Calls 3

into_innerMethod · 0.80
is_emptyMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected