Question about refer to module method

Hi there, I've encountered a strange syntax

#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn is_control(self) -> bool {
    unicode::Cc(self)
}

the Cc is confusing to me, it refers to module cc's method lookup, but I've got no idea how it works


#[rustfmt::skip]
pub mod cc {
    static SHORT_OFFSET_RUNS: [u32; 1] = [
        1114272,
    ];
    static OFFSETS: [u8; 5] = [
        0, 32, 95, 33, 0,
    ];
    pub fn lookup(c: char) -> bool {
        super::skip_search(
            c as u32,
            &SHORT_OFFSET_RUNS,
            &OFFSETS,
        )
    }
}

it's just re-exported as an alias. see:

Thanks for answering! I thought it’s some kind of syntax sugar that I’m not aware of :person_facepalming:.

Maybe rust-analyzer should have the ability to hint the alias (or maybe its already hinted but got ignored by me

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.