rust-analyzer/crates/ra-salsa/tests/incremental/log.rs
2024-10-14 10:09:22 -04:00

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()
}
}