]> git.lizzy.rs Git - rust.git/commit
Implement From<char> for u32, and From<u8> for char
authorSimon Sapin <simon.sapin@exyr.org>
Wed, 17 Aug 2016 15:41:33 +0000 (17:41 +0200)
committerSimon Sapin <simon.sapin@exyr.org>
Mon, 29 Aug 2016 15:34:02 +0000 (17:34 +0200)
commit41d0a89e3ad99a9fdf700ea7d15750fe1cbfab14
treeb837e9f2c8401f2a2ef300d2a2973e43231b69c3
parent86dde9bbda92c02c61282b5df5d38338a798ef3b
Implement From<char> for u32, and From<u8> for char

These fit with other From implementations between integer types.

This helps the coding style of avoiding the 'as' operator that sometimes
silently truncates, and signals that these specific conversions are
lossless and infaillible.
src/libcore/char.rs
src/libcoretest/char.rs