Skip to content

Commit 08037bc

Browse files
committed
add ProductValue::push
1 parent dc9bd2f commit 08037bc

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

crates/sats/src/product_value.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ impl From<ColId> for InvalidFieldError {
6969
}
7070

7171
impl ProductValue {
72+
/// Pushes a single value to he product.
73+
pub fn push(self, val: impl Into<AlgebraicValue>) -> Self {
74+
let mut vals: Vec<_> = self.elements.into();
75+
vals.reserve(1);
76+
vals.push(val.into());
77+
Self::from(vals)
78+
}
79+
7280
/// Borrow the value at field of `self` identified by `col_pos`.
7381
///
7482
/// The `name` is non-functional and is only used for error-messages.

0 commit comments

Comments
 (0)