Skip to content

Commit b04fcb9

Browse files
committed
feat: Added From<Scale> implementation for Vec
1 parent b2dbd4d commit b04fcb9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/models/common.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl<X, Y> From<(X, Y)> for Point<X, Y> {
2020
}
2121

2222
#[derive(Debug, Clone, PartialEq)]
23-
pub enum Scale<T>
23+
pub enum Scale<T = Data>
2424
where
2525
T: Clone + Debug,
2626
{
@@ -39,6 +39,17 @@ where
3939
}
4040
}
4141

42+
impl<T> From<Scale<T>> for Vec<T>
43+
where
44+
T: Clone + Debug,
45+
{
46+
fn from(value: Scale<T>) -> Self {
47+
match value {
48+
Scale::List(lst) => lst,
49+
}
50+
}
51+
}
52+
4253
#[cfg(test)]
4354
mod tests {
4455
use super::*;

0 commit comments

Comments
 (0)