jeudi 13 juillet 2017

Rust if ? syntax, is it supported?

How can I port this C++ code to Rust:

auto sgnR = (R >= 0.) ? 1. : -1.;

I have seen some examples with the match keyword, but I don't understand how it works.

Thanks!

Aucun commentaire:

Enregistrer un commentaire