Skip to content

Commit d1b2ea3

Browse files
committed
Fix compilation on 1.46
1 parent 7edc00b commit d1b2ea3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/init.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,25 @@ pub fn pyckitup_init(project_name: PathBuf) -> anyhow::Result<()> {
1212
project_name.display()
1313
);
1414
std::fs::create_dir_all(project_name.join("static"))?;
15+
fn bytesref(x: &[u8]) -> &[u8] {
16+
// hack to coerce to &[u8]
17+
x
18+
}
1519
std::fs::write(
1620
project_name.join("static/click.wav"),
17-
include_bytes!("../static/click.wav"),
21+
bytesref(include_bytes!("../static/click.wav")),
1822
)?;
1923
std::fs::write(
2024
project_name.join("run.py"),
21-
include_bytes!("../examples/clock.py"),
25+
bytesref(include_bytes!("../examples/clock.py")),
2226
)?;
2327
std::fs::write(
2428
project_name.join("common.py"),
25-
include_bytes!("../examples/common.py"),
29+
bytesref(include_bytes!("../examples/common.py")),
2630
)?;
2731
std::fs::write(
2832
project_name.join(".gitignore"),
29-
include_bytes!("../include/gitignore"),
33+
bytesref(include_bytes!("../include/gitignore")),
3034
)?;
3135
println!("Initialized. To run: `pyckitup run`");
3236

0 commit comments

Comments
 (0)