Skip to content

Commit

Permalink
FirestoreVector conversion functions update
Browse files Browse the repository at this point in the history
  • Loading branch information
abdolence committed Apr 13, 2024
1 parent e8f114c commit b0cee8e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/firestore_serde/vector_serializers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ impl FirestoreVector {
pub fn new(vec: Vec<f64>) -> Self {
FirestoreVector(vec)
}

pub fn into_vec(self) -> Vec<f64> {
self.0
}

pub fn as_vec(&self) -> &Vec<f64> {
&self.0
}
}

impl From<FirestoreVector> for Vec<f64> {
fn from(val: FirestoreVector) -> Self {
val.into_vec()
}
}

impl<I> From<I> for FirestoreVector
Expand Down

0 comments on commit b0cee8e

Please sign in to comment.