This file contains hidden or 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
| cargo new project_name | |
| // dailydoseofrust.com |
This file contains hidden or 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
| // Full tutorial https://www.youtube.com/watch?v=LJppDNH2CHI | |
| pub struct Calculator { | |
| result: f64, | |
| } | |
| impl Calculator { | |
| /// Creates a new Calculator instance with the initial result set to 0.0. | |
| pub fn new() -> Self { | |
| return Self { result: 0.0 }; |
This file contains hidden or 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
| // Full video tutorial here https://www.youtube.com/watch?v=LJppDNH2CHI | |
| use calculator::Calculator; | |
| fn main(){ | |
| let mut calculator = Calculator::new(); | |
| calculator | |
| .add([4.0,10.0,20.0].to_vec()) | |
| .subsctract([100.0].to_vec()); |
This file contains hidden or 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
| // Full tutorial here https://youtu.be/LJppDNH2CHI | |
| #[cfg(test)] | |
| mod test{ | |
| use crate::Calculator; | |
| #[test] | |
| fn test_addition(){ | |
| let mut calculator = Calculator::new(); |
This file contains hidden or 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
| { | |
| "Position_QB": | |
| { | |
| "lastUpdatedOn": "2025-09-04T16:09:07.763Z", | |
| "playerStatsTotals": [ | |
| { | |
| "player": { | |
| "id": 18631, | |
| "firstName": "Justin", | |
| "lastName": "Herbert", |
OlderNewer