E0352

A Secret used where it must be Display: a Display bound, or a call to .to_string(). Spans the call, or the method name.

Machine-applicable fix: none.

Example

This program fails with E0352.

fn main(env: Env) {
    let key = env.secret("API_KEY")
    let text = key.to_string()
}

Fixed

The same program, fixed.

fn main(env: Env) {
    let key = env.secret("API_KEY")
    let text = key.expose()
}

Listed in the checker notes. oskac explain E0352 prints this entry offline.

All error codes