I am new to rust and I don't completely understand how it works
I am trying to put what is the next county from the current one
use std::ptr::null;
struct County{
pub id: u32,
pub next: *const County,
}
fn main() {
let mut counties : Vec<County> = Vec::new();
for i in 0..10{
let county = County{id: i, next: null() };
counties.push(county);
}
for i in 1..10{
let county = counties.get(i).unwrap();
county.next = counties.get(i - 1).unwrap();
}
}