Skip to content

Commit

Permalink
The generator fails to compute the destination path since std won't n…
Browse files Browse the repository at this point in the history
…ormalize "file.rs/../directory".

This patch only removes the "file.rs" before normalization.
  • Loading branch information
davide-baldo committed Jan 17, 2023
1 parent c18de1b commit 4d3dc0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions protocol_codegen/src/generate_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use tempfile::tempdir;
pub fn run() -> Result<(), Error> {
let input_tmpdir = tempdir()?.into_path();

let mut dir = std::fs::canonicalize(std::file!())?;
dir.push("../../../src/messages");
let mut dir = std::fs::canonicalize(std::file!().rsplit_once("/").unwrap().0)?;
dir.push("../../src/messages");
let output_path = std::fs::canonicalize(dir)?;
let output_path = output_path.to_str().unwrap();

Expand Down

0 comments on commit 4d3dc0d

Please sign in to comment.