aboutsummaryrefslogtreecommitdiff
path: root/src/convert.rs
diff options
context:
space:
mode:
authorJames Farrell <jamesfarrell@google.com>2023-08-15 17:25:00 +0000
committerJames Farrell <jamesfarrell@google.com>2023-08-15 17:40:26 +0000
commit5c471c4a5c3e80c810dadb19c5996e420426c3bc (patch)
tree776963f06ac58a6bb87f22179ffa07a9401eadad /src/convert.rs
parent0f3d74e8f41021bd82e05a51ebbe0f067fcdfe0a (diff)
downloadproc-macro2-5c471c4a5c3e80c810dadb19c5996e420426c3bc.tar.gz
Upgrade proc-macro2 to 1.0.66emu-33-dev
This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update rust/crates/proc-macro2 For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md Test: TreeHugger Change-Id: I42a7ce27e4cee2efe110c6efc63fb215ab0e4c9a Bug: 295883071
Diffstat (limited to 'src/convert.rs')
-rw-r--r--src/convert.rs19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/convert.rs b/src/convert.rs
deleted file mode 100644
index afc5faf..0000000
--- a/src/convert.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-pub(crate) fn usize_to_u32(u: usize) -> Option<u32> {
- #[cfg(not(no_try_from))]
- {
- use core::convert::TryFrom;
-
- u32::try_from(u).ok()
- }
-
- #[cfg(no_try_from)]
- {
- use core::mem;
-
- if mem::size_of::<usize>() <= mem::size_of::<u32>() || u <= u32::max_value() as usize {
- Some(u as u32)
- } else {
- None
- }
- }
-}