Skip to content

Commit 59a43e1

Browse files
nyurikpvdrz
authored andcommitted
Use appropriate rustfmt --format ... param
This fixes the issue with c-string literals which require edition 2021. Now the edition is automatically computed if not specified.
1 parent 78adb33 commit 59a43e1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bindgen/lib.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl std::fmt::Display for Formatter {
208208
Self::Prettyplease => "prettyplease",
209209
};
210210

211-
s.fmt(f)
211+
std::fmt::Display::fmt(&s, f)
212212
}
213213
}
214214

@@ -999,6 +999,12 @@ impl Bindings {
999999
cmd.args(["--config-path", path]);
10001000
}
10011001

1002+
let edition = self
1003+
.options
1004+
.rust_edition
1005+
.unwrap_or_else(|| self.options.rust_target.latest_edition());
1006+
cmd.args(["--edition", &format!("{edition}")]);
1007+
10021008
let mut child = cmd.spawn()?;
10031009
let mut child_stdin = child.stdin.take().unwrap();
10041010
let mut child_stdout = child.stdout.take().unwrap();

0 commit comments

Comments
 (0)