24 results for "whoa":

The curse of strong typing

show(get_char_or_int(false)); } $ cargo run --quiet C 64 Whoa. Whoa whoa whoa, that could be its own article! Yes. And yet here we are. And there’s unsafe code in there, how do you know it’s okay? Well, miri is happy about it, so that’s a good start: $ cargo +nightly miri run --quiet C 64 And do I really need to write code like that? No you
The thumbnail for this page

Day 1 (Advent of Code 2020)

quiet [src/main.rs:3] s.next() = Some( "1470", ) [src/main.rs:4] s.next() = Some( "1577", ) [src/main.rs:5] s.next() = Some( "1054", ) Hold on a second, I’m getting a warning: Whoa, you have inline error messages? Yeah, it’s the Error Lens vscode extension, it’s pretty neat! Okay so, about that error - it’s not really an error
The thumbnail for this page

Implementing "Log in with GitHub"

refresh credentials pub trait CredentialsRefresher { fn refresh<'b>( &'b self, creds: &'b FutileCredentials, ) -> Pin<Box<dyn Future<Output = eyre::Result<FutileCredentials>> + Send + 'b>>; } What’s interesting here is that the returned future is Send, and Unpin (since it’s on the heap), a- Whoa whoa whoa you’re not
The thumbnail for this page

Day 4 (Advent of Code 2020)

results = include_str!("input.txt") .split("\n\n") .map(|input| PassportBuilder::parse(input).and_then(|b| b.build())); let num_valid = results.filter(Result::is_ok).count(); println!("{} passport records were valid", num_valid); } $ cargo run --quiet 194 passport records were valid Whoa, we actually got it right the first
The thumbnail for this page

That health is mental

the morning was too much, and going to the zoo almost resulted in a meltdown in the middle of all those people. I’ve never been that angry at people. Why are you here? Why are you speaking? Why do you exist? Did you really need to make kids? WHO MANUFACTURES A SCOOTER WITH A MOUNTED TOY GUN COMPLETE WITH SOUND EFFECTS???? Whoa, but seriously, who
The thumbnail for this page

In the bowels of glibc

lib64/ld-linux-x86-64.so.2 Whoa. WHOA! It’s a function provided by ld-linux-x86-64.so.2! Yes! glibc’s dynamic linker slash loader! Yes!! Well yeah! It’s freaking dladdr, what did you expect? ld-linux.so, the loader, loads the binary, ls, which is itself linked against libc.so, which ends up calling back into ld.so, which is really what ld
The thumbnail for this page

Day 2 (Advent of Code 2020)

just derive them: #[derive(PartialEq, Debug)] struct PasswordPolicy { byte: u8, range: RangeInclusive<usize>, } Whoa! Does that work because both u8 and RangeInclusive<usize> implement PartialEq and Debug? Yup! And they’re not implemented by default for all new structs because, well, if you don’t need them that’s just extra code in
The thumbnail for this page

Day 11 (Advent of Code 2022)

pub fn eval(self, old: u64) -> u64 { match self { Term::Old => old, Term::Constant(c) => c, } } } And then, whoa here we go: use nom::{ branch::alt, bytes::complete::tag, character::complete as cc, character::complete::{one_of, space1}, combinator::{map, value}, error::ParseError
The thumbnail for this page

A simple ping library, parsing strings into IPv4 address

let IcmpSendEcho: IcmpSendEcho = unsafe { iphlp.get_proc("IcmpSendEcho").unwrap() }; IcmpSendEcho( handle, dest, request_data, request_size, request_options, reply_buffer, reply_size, timeout, ) } Whoa. Okay, yeah, we’re definitely going to need to come back to that. But for

Why is my Rust build so slow?

adding cargo-features = ["edition2021"] did the trick). Here are the timings: Cold 1.54.0 build: 1m12s (vs 2m04s for 1.57.0) Hot 1.54.0 build: 18.07s (vs 1m11s for 1.57.0) Whoa. WHOA. Yeah. It’s a pretty bad regression. And it is known. Apparently Rust 1.58 should improve the situation. Does that mean… nightly should do better? $ rustup