Skip to content

Commit

Permalink
Fix: wrong path in Objects::filepath
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Jul 12, 2023
1 parent 443a1aa commit aa885d9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/re_types_builder/src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ impl Docs {
.with_context(|| format!("couldn't parse included path: {raw_path:?}"))
.unwrap();

let path = filepath.join(path);
let path = filepath.parent().unwrap().join(path);

included_files
.entry(path.clone())
Expand Down Expand Up @@ -416,7 +416,13 @@ impl Object {
.map(ToOwned::to_owned)
.with_context(|| format!("no declaration_file found for {fqname}"))
.unwrap();
assert!(virtpath.ends_with(".fbs"), "Bad virtpath: {virtpath:?}");

let filepath = filepath_from_declaration_file(include_dir_path, &virtpath);
assert!(
filepath.to_string().ends_with(".fbs"),
"Bad filepath: {filepath:?}"
);

let docs = Docs::from_raw_docs(&filepath, obj.documentation());
let kind = ObjectKind::from_pkg_name(&pkg_name);
Expand Down Expand Up @@ -1075,8 +1081,6 @@ fn filepath_from_declaration_file(
) -> Utf8PathBuf {
include_dir_path.as_ref().join("rerun").join(
Utf8PathBuf::from(declaration_file.as_ref())
.parent()
.unwrap() // NOTE: safe, this _must_ be a file
.to_string()
.replace("//", ""),
)
Expand Down

0 comments on commit aa885d9

Please sign in to comment.