Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ra-salsa/tests/incremental/log.rs')
| -rw-r--r-- | crates/ra-salsa/tests/incremental/log.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/ra-salsa/tests/incremental/log.rs b/crates/ra-salsa/tests/incremental/log.rs new file mode 100644 index 0000000000..1ee57fe667 --- /dev/null +++ b/crates/ra-salsa/tests/incremental/log.rs @@ -0,0 +1,16 @@ +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() + } +} |