distinct MessageName and WireName types could be over-engineering, but WireName might be usefully faster for parsing a QNAME, and usefully stricter for RDATA fields that must not be compressed
1
ooh this is helpful, it tells me what my CPU is
$ rustc --print target-cpus
Available CPUs for this target:
native - Select the CPU of the current host (currently skylake).
(etc)
1
did i really just write 50 lines of rust that passed the compiler first time?!1?!/!?!eleventy?!
with double indirections because peekable() is annoying?!
1
5
iβm staring at my dns name code and thinking that i have left case folding too late because it is making comparisons too complicated
2
1
iβm trying to make sure that my code doesnβt unnecessarily copy dns names
e.g. let thing: BigStruct = fill_bigstruct_from(&data);
i would like the filling to write directly to the callerβs stack frame
and Iβm looking at github.com/rust-lang/rust/isβ¦
so i need to do NRVO manually?
2
trying to choose a method nameβ¦ reset? clear? I type βfn clearβ then check what Vec calls it :- βclearβ. Yay :-)
1
2
kind of disappointed that i need the impl here
and now iβm not sure if the supertrait is doing anything useful
trait HeapLen: DnsName {
fn heap_len(&self) -> usize {
1 + self.labs() + self.nlen()
}
}
impl<T: DnsName> HeapLen for T {}
1
the answer is that the supertrait is bringing the necessary methods into scope
in the other case where i had a default function implementation, the methods it called were in the same trait
1
macro_rules is annoyingly parse-order scoped rather than lexically scoped. make sure your macro is *before* its use in your codebase's parse order.
May 22, 2021 Β· 8:35 PM UTC
1

