Skip to content

Commit

Permalink
Add as_read_only() for OnwedListSexp
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation committed Jan 17, 2024
1 parent af94640 commit fa7817e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### New features

* Add `is_null()`.
* Add `as_read_only()` to `OwnedListSexp` as well.

## [v0.2.4] (2024-01-15)

Expand Down
4 changes: 4 additions & 0 deletions src/sexp/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ impl OwnedListSexp {
self.len == 0
}

pub fn as_read_only(&self) -> ListSexp {
ListSexp(self.inner())
}

pub fn get(&self, k: &str) -> Option<Sexp> {
self.values.get(k)
}
Expand Down

0 comments on commit fa7817e

Please sign in to comment.