Skip to content

Commit eb89516

Browse files
bors[bot]japaric
andcommitted
Merge #26
26: fix include; make build scripts more similar to each other r=therealprof a=japaric r? @rust-embedded/resources Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2 parents 68e14cf + 926e4f7 commit eb89516

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

ci/main/rt/build.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
use std::env;
2-
use std::error::Error;
3-
use std::fs::File;
4-
use std::io::Write;
5-
use std::path::PathBuf;
1+
use std::{env, error::Error, fs::File, io::Write, path::PathBuf};
62

73
fn main() -> Result<(), Box<Error>> {
84
// build directory for this crate
9-
let mut out = PathBuf::from(env::var_os("OUT_DIR").unwrap());
5+
let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
106

117
// extend the library search path
12-
println!("cargo:rustc-link-search={}", out.display());
8+
println!("cargo:rustc-link-search={}", out_dir.display());
139

1410
// put `link.x` in the build directory
15-
out.push("link.x");
16-
File::create(out)?.write_all(include_bytes!("link.x"))?;
11+
File::create(out_dir.join("link.x"))?.write_all(include_bytes!("link.x"))?;
1712

1813
Ok(())
1914
}

src/main.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ $ tail -n2 Cargo.toml
7272
```
7373

7474
``` toml
75-
{{#include ../ci/main/app/src/Cargo.toml:7:8}}
75+
{{#include ../ci/main/app/Cargo.toml:7:8}}
7676
```
7777

7878
``` console

0 commit comments

Comments
 (0)