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 authored and pvdrz committed Jan 2, 2025
1 parent 78adb33 commit 59a43e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bindgen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl std::fmt::Display for Formatter {
Self::Prettyplease => "prettyplease",
};

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

Expand Down Expand Up @@ -999,6 +999,12 @@ 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 59a43e1

Please sign in to comment.