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
repeatedly trying to #[macro_use] a module and invoke one of its macros, and yet rustc insists the macro is not visible and have I forgotten to #[macro_use]?
2
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.
1
Or all your macros in a macros.rs and `#[macro_use] pub mod macros` at the top :D
1
bummer
May 22, 2021 Β· 8:42 PM UTC

