Last active
September 7, 2022 20:19
-
-
Save aletheia/937225cbb0000a23ae27c34e5c831333 to your computer and use it in GitHub Desktop.
a trait to cast User into Vec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl From<&User> for Vec<f64> { | |
fn from(user: &User) -> Vec<f64> { | |
vec![ | |
user.senior_citizen as f64, | |
user.tenure as f64, | |
user.monthly_charges, | |
user.total_charges, | |
// ... more fields are omitted for brevity | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
done