impl Store::delete() interface function

This commit is contained in:
Matthias Beyer 2017-01-21 19:54:34 +01:00
parent c2b146aad8
commit c87fa74169

View file

@ -209,7 +209,19 @@ methods!(
// On error: Nil + Exception
//
fn delete(sid: RStoreId) -> NilClass {
unimplemented!()
let sid = typecheck!(sid).unwrap().clone();
call_on_store! {
store <- itself wrapped inside STORE_WRAPPER,
operation {
if let Err(e) = store.delete(sid) {
trace_error(&e);
VM::raise(Class::from_existing("RuntimeError"), e.description());
}
NilClass::new()
},
on fail return NilClass::new()
}
}
// Save a FileLockEntry in a new path inside the store, keep the RFileLockEntry