salsa/tests/incremental/log.rs

17 lines
307 B
Rust
Raw Normal View History

use std::cell::RefCell;
#[derive(Default)]
2018-10-09 19:34:30 +00:00
pub(crate) struct Log {
data: RefCell<Vec<String>>,
}
impl Log {
2018-10-09 19:34:30 +00:00
pub(crate) fn add(&self, text: impl Into<String>) {
self.data.borrow_mut().push(text.into());
}
2018-10-09 19:34:30 +00:00
pub(crate) fn take(&self) -> Vec<String> {
2021-10-31 08:13:42 +00:00
self.data.take()
}
}