mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-24 16:21:04 +00:00
18 lines
341 B
Rust
18 lines
341 B
Rust
use std::mem;
|
|
|
|
#[derive(Debug, Default)]
|
|
pub struct InputHistory {
|
|
pub name: String,
|
|
|
|
pub(super) at: Option<usize>,
|
|
pub(super) draft: String,
|
|
}
|
|
|
|
impl InputHistory {
|
|
pub(super) fn new(name: String) -> Self { Self { name, ..Default::default() } }
|
|
|
|
pub fn take(&mut self) -> String {
|
|
self.at = None;
|
|
mem::take(&mut self.draft)
|
|
}
|
|
}
|