WIP fix of folder crash / indent

This commit is contained in:
otdavies
2021-12-31 02:39:59 -08:00
parent 401bba878a
commit 3a74f44d86
4 changed files with 95 additions and 25 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ impl Folder {
}
pub fn position_of_layer(&self, layer_id: LayerId) -> Result<usize, DocumentError> {
self.layer_ids.iter().position(|x| *x == layer_id).ok_or(DocumentError::LayerNotFound)
self.layer_ids.iter().position(|x| *x == layer_id).ok_or_else(|| DocumentError::LayerNotFound([layer_id].into()))
}
pub fn folder(&self, id: LayerId) -> Option<&Folder> {