You can use the format! macro. It is more readable, more translation-friendly, more efficient, and more powerful (you can concatenate more than just strings, just like C++'s ostringstream). It is also completely type-safe.

foo(format!("Hello, {}", "world!"));


Rust does not have user-defined literals. I think adding such a feature is backward-compatible, so maybe this feature will be added after Rust 1.0.

A more convenient concatenation with a string literal in Rust
I have the following power supply configuration:
AC MAINS -> UPS -> 24V POWER SUPPLY -> 5V VOLTAGE REGULATOR -> PCB (microcontroller).
What's the best solution to detect the power outage on the mains with the microcontroller?
I also need to detect the zero-crossing so that I can control the speed of an AC motor.
