Debian Codegraph @

debian/rust-vendor/zerofrom/src/lib.rs

raw
1 // This file is part of ICU4X. For terms of use, please see the file
2 // called LICENSE at the top level of the ICU4X source tree
3 // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4
5 // https://github.com/unicode-org/icu4x/blob/main/documents/process/boilerplate.md#library-annotations
6 #![cfg_attr(not(any(test, doc)), no_std)]
7 #![cfg_attr(
8 not(test),
9 deny(
10 clippy::indexing_slicing,
11 clippy::unwrap_used,
12 clippy::expect_used,
13 clippy::panic,
14 )
15 )]
16 #![warn(missing_docs)]
17
18 //! This crate provides [`ZeroFrom`], a trait for converting types in a zero-copy way.
19 //!
20 //! See the documentation of [`ZeroFrom`] for more details.
21
22 // The lifetimes here are important for safety and explicitly writing
23 // them out is good even when redundant
24 #![allow(clippy::needless_lifetimes)]
25
26 #[cfg(feature = "alloc")]
27 extern crate alloc;
28
29 mod macro_impls;
30 mod zero_from;
31
32 #[cfg(feature = "derive")]
33 pub use zerofrom_derive::ZeroFrom;
34
35 pub use crate::zero_from::ZeroFrom;