Compare plain list type in diff.rs.
This commit is contained in:
@@ -190,3 +190,15 @@ pub(crate) fn get_property<'s, 'x>(
|
||||
};
|
||||
Ok(Some(*prop))
|
||||
}
|
||||
|
||||
/// Get a named property containing an unquoted atom from the emacs token.
|
||||
///
|
||||
/// Returns None if key is not found.
|
||||
pub(crate) fn get_property_unquoted_atom<'s, 'x>(
|
||||
emacs: &'s Token<'s>,
|
||||
key: &'x str,
|
||||
) -> Result<Option<&'s str>, Box<dyn std::error::Error>> {
|
||||
Ok(get_property(emacs, key)?
|
||||
.map(Token::as_atom)
|
||||
.map_or(Ok(None), |r| r.map(Some))?)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user