We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 673f460 commit 5b5ec10Copy full SHA for 5b5ec10
build.rs
@@ -58,10 +58,6 @@ fn main() {
58
println!("cargo:rustc-cfg=span_locations");
59
}
60
61
- if version.minor < 34 {
62
- println!("cargo:rustc-cfg=no_try_from");
63
- }
64
-
65
if version.minor < 39 {
66
println!("cargo:rustc-cfg=no_bind_by_move_pattern_guard");
67
src/convert.rs
@@ -1,17 +1,3 @@
1
pub(crate) fn usize_to_u32(u: usize) -> Option<u32> {
2
- #[cfg(not(no_try_from))]
3
- {
4
- u32::try_from(u).ok()
5
6
7
- #[cfg(no_try_from)]
8
9
- use core::mem;
10
11
- if mem::size_of::<usize>() <= mem::size_of::<u32>() || u <= u32::max_value() as usize {
12
- Some(u as u32)
13
- } else {
14
- None
15
16
+ u32::try_from(u).ok()
17
0 commit comments