Skip to content

Commit c26b868

Browse files
committed
Last adjustments for the PR
1 parent 60e1fa4 commit c26b868

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

cargo-marker/src/driver.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,16 @@ fn build_driver(toolchain: &str, version: &str, verbose: bool, dev_build: bool)
9999
if dev_build {
100100
cmd.args(["build", "--bin", "marker_driver_rustc"]);
101101
} else {
102-
// TODO Set output path to the local branch thingy
102+
// FIXME: This currently installs the binary in Cargo's default location.
103+
// Ideally this should install the driver in the toolchain folder for the
104+
// installed nightly version. This would allow the user to have multiple
105+
// drivers depending on the project toolchain.
106+
//
107+
// We can just reuse rustup to select the correct driver for a defined
108+
// toolchain. This would also simulate how the driver would be delivered
109+
// in a perfect world.
110+
//
111+
// See #60
103112
cmd.args(["install", "marker_rustc_driver", "--version", version]);
104113
}
105114

cargo-marker/src/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mod lints;
99
use std::{
1010
ffi::{OsStr, OsString},
1111
fs::create_dir_all,
12-
io::{self, Write},
12+
io,
1313
path::{Path, PathBuf},
1414
process::exit,
1515
};
@@ -138,6 +138,7 @@ fn print_version(verbose: bool) {
138138
}
139139
}
140140

141+
#[allow(clippy::unnecessary_wraps)]
141142
fn print_env(env: Vec<(OsString, OsString)>) -> io::Result<()> {
142143
// Operating systems are fun... So, this function prints out the environment
143144
// values to the standard output. For Unix systems, this requires `OsStr`
@@ -151,6 +152,7 @@ fn print_env(env: Vec<(OsString, OsString)>) -> io::Result<()> {
151152

152153
#[cfg(any(target_os = "linux", target_os = "macos"))]
153154
{
155+
use std::io::Write;
154156
use std::os::unix::prelude::OsStrExt;
155157

156158
// stdout is used directly, to print the `OsString`s without requiring
@@ -164,7 +166,7 @@ fn print_env(env: Vec<(OsString, OsString)>) -> io::Result<()> {
164166
writeln!(lock)?;
165167
}
166168

167-
return Ok(());
169+
Ok(())
168170
}
169171

170172
#[cfg(target_os = "windows")]
@@ -177,6 +179,6 @@ fn print_env(env: Vec<(OsString, OsString)>) -> io::Result<()> {
177179
}
178180
}
179181

180-
return Ok(());
182+
Ok(())
181183
}
182184
}

0 commit comments

Comments
 (0)