Skip to content

Commit 0603397

Browse files
committed
Fix formatting
1 parent 1f53603 commit 0603397

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Fixed
1313

1414
- When passed a global command with the same name as a file in the current directory,
15-
Rustwide will now execute the global command instead of the file.
15+
Rustwide will now execute the global command instead of the file.
1616

1717
## [0.8.0] - 2020-06-05
1818

src/cmd/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ impl<'w, 'pl> Command<'w, 'pl> {
373373
// global paths should never be normalized
374374
Binary::Global(path) => (path, false),
375375
Binary::ManagedByRustwide(path) => {
376-
let binary = self.workspace
376+
let binary = self
377+
.workspace
377378
.expect("calling rustwide bins without a workspace is not supported")
378379
.cargo_home()
379380
.join("bin")

tests/issue_30.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,21 @@ const USER_AGENT: &str = "rustwide-tests (https://github.com/rust-lang/rustwide)
66

77
#[test]
88
fn run_binary_with_same_name_as_file() -> Result<(), Error> {
9-
use std::fs;
9+
use std::fs;
1010

1111
let env = env_logger::Builder::new()
1212
.filter_module("rustwide", log::LevelFilter::Info)
1313
.default_format_timestamp(false)
1414
.is_test(true)
1515
.build();
1616
rustwide::logging::init_with(env);
17-
let tmpdir = tempfile::tempdir()?;
18-
std::env::set_current_dir(&tmpdir)?;
19-
fs::write("true", b"foobar")?;
20-
let workspace = WorkspaceBuilder::new(tempfile::tempdir()?.path(), USER_AGENT).fast_init(true).init()?;
21-
Command::new(&workspace, "true").run()?;
17+
let tmpdir = tempfile::tempdir()?;
18+
std::env::set_current_dir(&tmpdir)?;
19+
fs::write("true", b"foobar")?;
20+
let workspace = WorkspaceBuilder::new(tempfile::tempdir()?.path(), USER_AGENT)
21+
.fast_init(true)
22+
.init()?;
23+
Command::new(&workspace, "true").run()?;
2224

23-
Ok(())
25+
Ok(())
2426
}

0 commit comments

Comments
 (0)