diff --git a/packages/common/y-octo/core/src/doc/types/array.rs b/packages/common/y-octo/core/src/doc/types/array.rs index 6581895a20..3cf6c3aced 100644 --- a/packages/common/y-octo/core/src/doc/types/array.rs +++ b/packages/common/y-octo/core/src/doc/types/array.rs @@ -36,15 +36,13 @@ impl Array { pub fn get(&self, index: u64) -> Option { let (item, offset) = self.get_item_at(index)?; - if let Some(item) = item.get() { + item.get().and_then(|item| { // TODO: rewrite to content.read(&mut [Any]) - return match &item.content { - Content::Any(any) => return any.get(offset as usize).map(|any| Value::Any(any.clone())), + match &item.content { + Content::Any(any) => any.get(offset as usize).map(|any| Value::Any(any.clone())), _ => Some(Value::from(&item.content)), - }; - } - - None + } + }) } pub fn iter(&self) -> ArrayIter {