23 results for "whoa":
The curse of strong typing
can use it!
fn get_char_or_int(give_char: bool) -> BoxedDisplay {
if give_char {
BoxedDisplay::new('C')
} else {
BoxedDisplay::new(64)
}
}
fn show(v: impl Display) {
println!("{v}");
}
fn main() {
show(get_char_or_int(true));
show(get_char_or_int(false));
}
$ cargo run --quiet
C
64
Whoa. Whoa whoa whoa
Day 1 (Advent of Code 2020)
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, it's a diagnostic from clippy, which... did I
Implementing "Log in with GitHub"
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 going to explain any of that? Already did....but its lifetime is 'b
Day 4 (Advent of Code 2020)
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 time! We always do 😎 Until next time, stay warm
In the bowels of glibc
calling exactly?(gdb) p/x $r13+0xf88
$1 = 0x7ffff7ffdf88
(gdb) x/xg $r13+0xf88
0x7ffff7ffdf88 <_rtld_global+3976>: 0x00007ffff7fd20e0
Interesting, interesting. It's definitely not null this time. But what is it?(gdb) info sym 0x00007ffff7fd20e0
rtld_lock_default_lock_recursive in section .text of /lib64/ld-linux-x86-64.so.2
Whoa. WHOA! It's a
Day 2 (Advent of Code 2020)
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 your binary you're not using - ie. bloat. With those changes, the tests compile, but fail
Day 11 (Advent of Code 2022)
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,
multi
A simple ping library, parsing strings into IPv4 address
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 now, we've got everything we want, I think
Why is my Rust build so slow?
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 install nightly
Surviving Rust async interfaces
cargo new surviving
Created binary (application) `surviving` package
$ cargo add argh sha3 color-eyre
Updating 'https://github.com/rust-lang/crates.io-index' index
Adding argh v0.1.3 to dependencies
Adding sha3 v0.9.1 to dependencies
Adding color-eyre v0.5.1 to dependencies
Whoa, amos, cool off. Why all the dependencies