mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 23:17:27 +00:00
Improves Rust code generation (#8564)
* Fixes checks for serde features in flexbuffers crate * Removes unused MapReaderIndexer use statement * Fixes warning about nightly cfg usage Enabling a cfg attribute through cargo::rustc-cfg in build.rs should be coupled with a cargo::rust-check-cfg value so that the compiler knows about the custom cfg. See: https://doc.rust-lang.org/rustc/check-cfg/cargo-specifics.html#cargorustc-check-cfg-for-buildrsbuild-script. * Migrates usage of deprecated float constants This update fixes a compiler warning from use of the old constants. Constants like EPSILON are now directly on the float primitives (e.g. f32::EPSILON) rather than in the f32 module (std::f32::EPSILON). The new constants have existed since 1.43.0, which appears to be below the MSRV for the flatbuffers crate. * Fixes incorrect key in flatbuffers Cargo.toml The old code was using package.rust, which triggered a warning about an unused key: warning: flatbuffers/rust/flatbuffers/Cargo.toml: unused manifest key: package.rust The correct key for specifying MSRV is rust-version. See: https://doc.rust-lang.org/cargo/reference/rust-version.html#rust-version. --------- Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
This commit is contained in:
@@ -160,7 +160,7 @@ impl<'de> VariantAccess<'de> for Reader<&'de [u8]> {
|
||||
impl<'de> Deserializer<'de> for Reader<&'de [u8]> {
|
||||
type Error = DeserializationError;
|
||||
fn is_human_readable(&self) -> bool {
|
||||
cfg!(deserialize_human_readable)
|
||||
cfg!(feature = "deserialize_human_readable")
|
||||
}
|
||||
|
||||
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
|
||||
|
||||
@@ -26,7 +26,7 @@ mod serialize;
|
||||
mod vector;
|
||||
pub use de::DeserializationError;
|
||||
pub use iter::ReaderIterator;
|
||||
pub use map::{MapReader, MapReaderIndexer};
|
||||
pub use map::MapReader;
|
||||
pub use vector::VectorReader;
|
||||
|
||||
/// All the possible errors when reading a flexbuffer.
|
||||
|
||||
Reference in New Issue
Block a user