this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

car inspector

`cargo run --example day_three_build_car` from project root

phil 69f50eb1 8bcf3fee

+24 -5
+21
shared/examples/day_three_build_car.rs
··· 1 + use shared::advent::challenges::day_three::repo::{ChallengeRecord, manufacture_car}; 2 + 3 + #[tokio::main] 4 + async fn main() { 5 + let car_bytes = manufacture_car( 6 + "did:plc:somebodyyyy".parse().unwrap(), 7 + "codes.advent.supersecret.verification", 8 + "1337", 9 + ChallengeRecord { 10 + created_at: "2026-01-01T12:00:00Z".into(), 11 + verification_code: "ABCDE-FGHIJ".to_string(), 12 + message: "what did the muffin say to the other muffin?".into(), 13 + }, 14 + ) 15 + .await 16 + .expect("failed to build car"); 17 + 18 + let path = "local/test.car"; 19 + std::fs::write(path, &car_bytes).expect("failed to write file"); 20 + println!("wrote {} bytes to {path}", car_bytes.len()); 21 + }
+3 -5
shared/src/advent/challenges/day_three/repo.rs
··· 40 40 41 41 // to the car! 42 42 let mut car_bytes = Vec::new(); 43 - { 44 - let cursor = Cursor::new(&mut car_bytes); // something CarStore can use 45 - let mut car = CarStore::create_with_roots(cursor, [repo.root()]).await?; 46 - repo.export_into(&mut car).await?; 47 - } 43 + let cursor = Cursor::new(&mut car_bytes); // something CarStore can use 44 + let mut car = CarStore::create_with_roots(cursor, [repo.root()]).await?; 45 + repo.export_into(&mut car).await?; 48 46 49 47 Ok(car_bytes) 50 48 }