kdwarn

Codeberg Mastodon Feeds

Home > Programming > Blog > Use format! to turn chars to string

Use format! to turn chars to string

June 30, 2022

daybook, rust | permalink

While working on a Rust exercise, at first I did some convoluted way of turning two chars into a string. But it's quite simple with the format! macro: format!("{ch}{next_ch}").