mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-29 06:23:25 +00:00
16 lines
307 B
Rust
16 lines
307 B
Rust
use std::cell::RefCell;
|
|
|
|
#[derive(Default)]
|
|
pub(crate) struct Log {
|
|
data: RefCell<Vec<String>>,
|
|
}
|
|
|
|
impl Log {
|
|
pub(crate) fn add(&self, text: impl Into<String>) {
|
|
self.data.borrow_mut().push(text.into());
|
|
}
|
|
|
|
pub(crate) fn take(&self) -> Vec<String> {
|
|
self.data.take()
|
|
}
|
|
}
|