▲ 514 ▼ Happens all the time (sh.itjust.works) submitted 2 years ago by Klaymore@sh.itjust.works to c/programmer_humor@programming.dev 22 comments fedilink hide all child comments
[–] trxxruraxvr@lemmy.world 11 points 2 years ago (5 children) Height should be a float permalink fedilink source hideshow 10 child comments replies: [–] ParanoiaComplex@lemmy.world 10 points 2 years ago* (1 child) I don't know Rust but jump typically moves the program counter, where the height represents the number of instructions to move permalink fedilink source parent hideshow 2 child comments replies: [–] trxxruraxvr@lemmy.world 14 points 2 years ago (1 child) Afaik rust doesn't have functions like that as they lead to unsafe code that's impossible to check variable lifetimes for. I think OP created the jump function. permalink fedilink source parent hideshow 2 child comments replies: [–] RustyNova@lemmy.world 14 points 2 years ago They created it. The compiler says the jump function is in src/main.rs permalink fedilink source parent [–] Klaymore@sh.itjust.works [S] 6 points 2 years ago (1 child) It's height in centimeters permalink fedilink source parent hideshow 2 child comments replies: [+] trxxruraxvr@lemmy.world 1 point 2 years ago [deleted] permalink fedilink source parent [–] fossphi@lemm.ee 4 points 2 years ago Chad quantised rust permalink fedilink source parent [–] crispy_kilt@feddit.de 2 points 2 years ago Never use floats. permalink fedilink source parent [–] SatouKazuma@programming.dev 1 point 2 years ago But then wouldn't it be fly(height: f64) instead of jump(height: i32)? permalink fedilink source parent
[–] ParanoiaComplex@lemmy.world 10 points 2 years ago* (1 child) I don't know Rust but jump typically moves the program counter, where the height represents the number of instructions to move permalink fedilink source parent hideshow 2 child comments replies: [–] trxxruraxvr@lemmy.world 14 points 2 years ago (1 child) Afaik rust doesn't have functions like that as they lead to unsafe code that's impossible to check variable lifetimes for. I think OP created the jump function. permalink fedilink source parent hideshow 2 child comments replies: [–] RustyNova@lemmy.world 14 points 2 years ago They created it. The compiler says the jump function is in src/main.rs permalink fedilink source parent
[–] trxxruraxvr@lemmy.world 14 points 2 years ago (1 child) Afaik rust doesn't have functions like that as they lead to unsafe code that's impossible to check variable lifetimes for. I think OP created the jump function. permalink fedilink source parent hideshow 2 child comments replies: [–] RustyNova@lemmy.world 14 points 2 years ago They created it. The compiler says the jump function is in src/main.rs permalink fedilink source parent
[–] RustyNova@lemmy.world 14 points 2 years ago They created it. The compiler says the jump function is in src/main.rs permalink fedilink source parent
[–] Klaymore@sh.itjust.works [S] 6 points 2 years ago (1 child) It's height in centimeters permalink fedilink source parent hideshow 2 child comments replies: [+] trxxruraxvr@lemmy.world 1 point 2 years ago [deleted] permalink fedilink source parent
[–] SatouKazuma@programming.dev 1 point 2 years ago But then wouldn't it be fly(height: f64) instead of jump(height: i32)? permalink fedilink source parent