fix: make impl Default explicit for Tape
This commit is contained in:
1 parent
c69afef621
commit
d2ad40262b
1 file changed
+10
-1
+10
-1
@@ -1,12 +1,21 @@
|
|||||||
use crate::machine::MachineMovement;
|
use crate::machine::MachineMovement;
|
||||||
|
|
||||||
#[derive(Default)]
|
|
||||||
pub struct Tape {
|
pub struct Tape {
|
||||||
left_half: Vec<TapeSymbol>,
|
left_half: Vec<TapeSymbol>,
|
||||||
right_half: Vec<TapeSymbol>,
|
right_half: Vec<TapeSymbol>,
|
||||||
head: HeadPosition,
|
head: HeadPosition,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for Tape {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
left_half: Default::default(),
|
||||||
|
right_half: vec![TapeSymbol::Zero],
|
||||||
|
head: Default::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Tape {
|
impl Tape {
|
||||||
pub fn move_head(&mut self, direction: &MachineMovement) {
|
pub fn move_head(&mut self, direction: &MachineMovement) {
|
||||||
match &direction {
|
match &direction {
|
||||||
|
|||||||
Reference in new issue
Block a user