Put context object behind a ref rather than mut ref
This commit puts context object, i.e., the implementor of the WASI snapshot, behind a reference `&self` rather than a mutable reference `&mut self`. As suggested by @alexcrichton, this gives the implementor the possibility to determine how it handles its interior mutability.
This commit is contained in:
@@ -11,7 +11,7 @@ wiggle::from_witx!({
|
||||
impl_errno!(types::Errno);
|
||||
|
||||
impl ints::Ints for WasiCtx {
|
||||
fn cookie_cutter(&mut self, init_cookie: types::Cookie) -> Result<types::Bool, types::Errno> {
|
||||
fn cookie_cutter(&self, init_cookie: types::Cookie) -> Result<types::Bool, types::Errno> {
|
||||
let res = if init_cookie == types::Cookie::START {
|
||||
types::Bool::True
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user