diff --git a/crates/re_types/definitions/fbs/scalars.fbs b/crates/re_types/definitions/fbs/scalars.fbs deleted file mode 100644 index 085df42e26db..000000000000 --- a/crates/re_types/definitions/fbs/scalars.fbs +++ /dev/null @@ -1,13 +0,0 @@ -/// Unions cannot directly refer to scalar types, they need to be wrapped in a struct or table -/// first. -/// This package provides pre-wrapped scalars that will be automatically flattened down to their -/// inner type by our parsers. -/// -/// Look e.g. for `fbs.scalars.Float32` in `objects.rs` to see this flatenning in action. - -namespace fbs.scalars; - -/// Flattens down to a 32-bit float. -struct Float32 { - v: float; -} diff --git a/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs index 36b2efc87a47..7ba0c8a62d0b 100644 --- a/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs @@ -1,6 +1,5 @@ include "arrow/attributes.fbs"; include "fbs/attributes.fbs"; -include "fbs/scalars.fbs"; include "rust/attributes.fbs"; namespace rerun.testing.datatypes; diff --git a/crates/re_types/source_hash.txt b/crates/re_types/source_hash.txt index 213108d612d7..f71e56dffc6b 100644 --- a/crates/re_types/source_hash.txt +++ b/crates/re_types/source_hash.txt @@ -1,4 +1,4 @@ # This is a sha256 hash for all direct and indirect dependencies of this crate's build script. # It can be safely removed at anytime to force the build script to run again. # Check out build.rs to see how it's computed. -fccdb1905f00757848831d294df37a5a03ae531b63f8a93eb93f09230116b097 \ No newline at end of file +dfeebe79deccb382827eaab2ae15a5cac391802477c771972967196c6406edca \ No newline at end of file diff --git a/crates/re_types_builder/src/objects.rs b/crates/re_types_builder/src/objects.rs index 6d52d7037653..714755edb2e7 100644 --- a/crates/re_types_builder/src/objects.rs +++ b/crates/re_types_builder/src/objects.rs @@ -51,12 +51,7 @@ impl Objects { } // resolve objects - for obj in schema - .objects() - .iter() - // NOTE: Wrapped scalar types used by unions, not actual objects: ignore. - .filter(|obj| !obj.name().starts_with("fbs.scalars.")) - { + for obj in schema.objects().iter() { let resolved_obj = Object::from_raw_object(include_dir_path, &enums, &objs, &obj); resolved_objs.insert(resolved_obj.fqname.clone(), resolved_obj); } @@ -802,7 +797,7 @@ impl Type { FbsBaseType::String => Self::String, FbsBaseType::Obj => { let obj = &objs[field_type.index() as usize]; - flatten_scalar_wrappers(obj).into() + Self::Object(obj.name().to_owned()) } FbsBaseType::Union => { let union = &enums[field_type.index() as usize]; @@ -917,7 +912,7 @@ impl ElementType { FbsBaseType::String => Self::String, FbsBaseType::Obj => { let obj = &objs[outer_type.index() as usize]; - flatten_scalar_wrappers(obj) + Self::Object(obj.name().to_owned()) } FbsBaseType::Union => unimplemented!("{inner_type:#?}"), // NOLINT FbsBaseType::None @@ -1020,19 +1015,6 @@ impl Attributes { } } -/// Helper to turn wrapped scalars into actual scalars. -fn flatten_scalar_wrappers(obj: &FbsObject<'_>) -> ElementType { - let name = obj.name(); - if name.starts_with("fbs.scalars.") { - match name { - "fbs.scalars.Float32" => ElementType::Float32, - _ => unimplemented!("{name:#?}"), // NOLINT - } - } else { - ElementType::Object(name.to_owned()) - } -} - fn filepath_from_declaration_file( include_dir_path: impl AsRef, declaration_file: impl AsRef,