Skip to content

Commit

Permalink
Add get_sort back
Browse files Browse the repository at this point in the history
  • Loading branch information
yihozhang authored Oct 24, 2024
1 parent af49ae2 commit 38b34d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,11 @@ impl EGraph {
self.type_info.sorts.get(&value.tag)
}

/// Returns a sort based on the type
pub fn get_sort<S: Sort + Send + Sync>(&self) -> Option<Arc<S>> {
self.type_info.get_sort_by(|_| true)
}

/// Returns the first sort that satisfies the type and predicate if there's one.
/// Otherwise returns none.
pub fn get_sort_by<S: Sort + Send + Sync>(
Expand Down

0 comments on commit 38b34d9

Please sign in to comment.