Skip to content

Commit 063bd1c

Browse files
committed
version bump, updated stam-rust dependency, and cleanup
1 parent d2df7e8 commit 063bd1c

3 files changed

Lines changed: 2 additions & 19 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "stam-python"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
edition = "2021"
55
authors = ["Maarten van Gompel <proycon@anaproy.nl>"]
66
description = "STAM is a library for dealing with standoff annotations on text"

src/annotation.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -438,21 +438,4 @@ impl PyAnnotation {
438438
))
439439
}
440440
}
441-
442-
/// Map function to act on the actual underlying store, helps reduce boilerplate
443-
fn map_mut<T, F>(&self, f: F) -> Result<T, PyErr>
444-
where
445-
F: FnOnce(&mut Annotation) -> Result<T, StamError>,
446-
{
447-
if let Ok(mut store) = self.store.write() {
448-
let annotation: &mut Annotation = store
449-
.get_mut(&self.handle.into())
450-
.map_err(|_| PyRuntimeError::new_err("Failed to resolve textresource"))?;
451-
f(annotation).map_err(|err| PyStamError::new_err(format!("{}", err)))
452-
} else {
453-
Err(PyRuntimeError::new_err(
454-
"Unable to obtain store (should never happen)",
455-
))
456-
}
457-
}
458441
}

src/annotationstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl PyAnnotationStore {
102102

103103
/// Saves the annotation store to file
104104
fn to_file(&mut self, filename: &str) -> PyResult<()> {
105-
self.set_filename(filename);
105+
self.set_filename(filename)?;
106106
self.save()
107107
}
108108

0 commit comments

Comments
 (0)