Skip to content
TILens What matters today in tech v0.3.0
Theme

Topic - Edition

Rust

4 items on 10 Oct 2026
Rust

Why would `as_ref()` be required here rather than a reference?

After playing around with newtypes a bit, I'm curious about this use of the AsRef trait: impl PaliSearcher { pub fn new(index: &PaliIndex) -> Result<Self> { let reader = Self::reader(index.as_ref())?; let uid =…

Source: Rust Users Forum jhanarato