diff --git a/rust/parser/src/main.rs b/rust/parser/src/main.rs index 7881b4bd..7ffed714 100644 --- a/rust/parser/src/main.rs +++ b/rust/parser/src/main.rs @@ -223,6 +223,8 @@ fn tokenizer<'state, 'input: 'state>( }) } +// This isn't a C thingy, it is just needed to make rust happy + struct TokenizerWrapper<'input> { _marker: std::marker::PhantomPinned, first_pass: TokenizerState<'input>, @@ -233,8 +235,7 @@ impl<'input> TokenizerWrapper<'input> { fn new(s: TokenizerState<'input>) -> Pin> { let mut value = Box::new(std::mem::MaybeUninit::::uninit()); unsafe { - // - let ptr: *mut Self = value.as_mut_ptr(); + let ptr = value.as_mut_ptr(); std::ptr::write(std::ptr::addr_of_mut!((*ptr).first_pass), s); std::ptr::write( std::ptr::addr_of_mut!((*ptr).iter), @@ -251,6 +252,8 @@ impl<'input> TokenizerWrapper<'input> { } } +// end of rust thingy + struct ExpenderState<'input> { // These will be inserted when a substitution is made, like $HOME // if it is "$HOME", then no splitting should be done, so if there is any stuff that needs to