clone once instead of twice
This commit is contained in:
parent
66d9279445
commit
b0df1fb3bd
@ -104,11 +104,11 @@ impl Instance{
|
||||
Ok(instance.name.clone())
|
||||
})
|
||||
});
|
||||
fields.add_field_method_set("Name",|lua,this,val:String|{
|
||||
dom(lua,move|dom|{
|
||||
fields.add_field_method_set("Name",|lua,this,val:mlua::String|{
|
||||
dom(lua,|dom|{
|
||||
let instance=this.get_mut(dom)?;
|
||||
//Why does this need to be cloned?
|
||||
instance.name=val.clone();
|
||||
instance.name=val.to_str()?.to_owned();
|
||||
Ok(())
|
||||
})
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user