|
1 | | -use alloc::{borrow::Cow, rc::Rc, string::String, vec::Vec}; |
| 1 | +use alloc::{rc::Rc, string::String, vec::Vec}; |
2 | 2 | use core::{cell::Cell, time::Duration}; |
3 | 3 | #[cfg(feature = "std")] |
4 | 4 | use std::time::Instant; |
@@ -188,10 +188,10 @@ impl LogicVMBuilder { |
188 | 188 | } |
189 | 189 |
|
190 | 190 | pub fn build(self) -> VMLoadResult<LogicVM> { |
191 | | - self.build_with_globals(Cow::Owned(LVar::create_global_constants())) |
| 191 | + self.build_with_globals(&LVar::create_global_constants()) |
192 | 192 | } |
193 | 193 |
|
194 | | - pub fn build_with_globals(mut self, globals: Cow<'_, Constants>) -> VMLoadResult<LogicVM> { |
| 194 | + pub fn build_with_globals(mut self, globals: &Constants) -> VMLoadResult<LogicVM> { |
195 | 195 | // sort processors in update order |
196 | 196 | // 7 8 9 |
197 | 197 | // 4 5 6 |
@@ -227,7 +227,7 @@ impl LogicVMBuilder { |
227 | 227 | .data |
228 | 228 | .borrow_mut() |
229 | 229 | .unwrap_processor_mut() |
230 | | - .late_init(&vm, processor, &globals)?; |
| 230 | + .late_init(&vm, processor, globals)?; |
231 | 231 | } |
232 | 232 |
|
233 | 233 | Ok(vm) |
@@ -272,7 +272,7 @@ pub enum VMLoadError { |
272 | 272 |
|
273 | 273 | #[cfg(all(test, not(feature = "std"), feature = "no_std"))] |
274 | 274 | mod tests { |
275 | | - use alloc::{borrow::Cow, boxed::Box, rc::Rc, vec}; |
| 275 | + use alloc::{boxed::Box, rc::Rc, vec}; |
276 | 276 | use core::{cell::RefCell, time::Duration}; |
277 | 277 |
|
278 | 278 | use pretty_assertions::assert_eq; |
@@ -336,7 +336,7 @@ mod tests { |
336 | 336 | }, |
337 | 337 | &builder, |
338 | 338 | )]); |
339 | | - let vm = builder.build_with_globals(Cow::Owned(globals)).unwrap(); |
| 339 | + let vm = builder.build_with_globals(&globals).unwrap(); |
340 | 340 |
|
341 | 341 | vm.do_tick(Duration::ZERO); |
342 | 342 |
|
@@ -419,7 +419,7 @@ mod tests { |
419 | 419 | ) |
420 | 420 | .unwrap(), |
421 | 421 | ); |
422 | | - builder.build_with_globals(Cow::Borrowed(globals)).unwrap() |
| 422 | + builder.build_with_globals(globals).unwrap() |
423 | 423 | } |
424 | 424 |
|
425 | 425 | fn run(vm: &mut LogicVM, max_ticks: usize, want: bool) { |
|
0 commit comments