Skip to content

Commit

Permalink
get rid of the old fbs.scalar stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jul 6, 2023
1 parent 26e5590 commit b875a56
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 36 deletions.
13 changes: 0 additions & 13 deletions crates/re_types/definitions/fbs/scalars.fbs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include "arrow/attributes.fbs";
include "fbs/attributes.fbs";
include "fbs/scalars.fbs";
include "rust/attributes.fbs";

namespace rerun.testing.datatypes;
Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/source_hash.txt
Original file line number Diff line number Diff line change
@@ -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
dfeebe79deccb382827eaab2ae15a5cac391802477c771972967196c6406edca
24 changes: 3 additions & 21 deletions crates/re_types_builder/src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<Path>,
declaration_file: impl AsRef<str>,
Expand Down

0 comments on commit b875a56

Please sign in to comment.