Skip to content

Commit

Permalink
Use appropriate rustfmt --format ... param
Browse files Browse the repository at this point in the history
This fixes the issue with c-string literals which require edition 2021. Now the edition is automatically computed if not specified.
  • Loading branch information
nyurik committed Dec 27, 2024
1 parent 0917399 commit 7b7f96e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bindgen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ impl std::fmt::Display for Formatter {
Self::Prettyplease => "prettyplease",
};

s.fmt(f)
std::fmt::Display::fmt(&s, f)
}
}

Expand Down Expand Up @@ -997,6 +997,9 @@ impl Bindings {
cmd.args(["--config-path", path]);
}

let edition = self.options.rust_edition.unwrap_or_else(|| self.options.rust_target.latest_edition());
cmd.args(["--edition", &format!("{edition}")]);

let mut child = cmd.spawn()?;
let mut child_stdin = child.stdin.take().unwrap();
let mut child_stdout = child.stdout.take().unwrap();
Expand Down

0 comments on commit 7b7f96e

Please sign in to comment.