Skip to content

Commit

Permalink
Fix bug in --no-private flag on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Aug 28, 2023
1 parent 3785e32 commit a492990
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com

## [Unreleased]

- Fix bug in `--no-private` flag on Windows.

## [0.6.2] - 2023-08-28

- Work around spurious "failed to select a version" error when `--version-range` option is used.
Expand Down
6 changes: 3 additions & 3 deletions src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub(crate) fn with(cx: &Context, f: impl FnOnce() -> Result<()>) -> Result<()> {
"--no-private is not supported yet with workspace with private root crate"
);
}
private_crates.push(manifest_path);
private_crates.push(manifest_path.canonicalize()?);
} else if is_root && no_private {
//
} else if no_dev_deps {
Expand Down Expand Up @@ -197,7 +197,7 @@ fn remove_dev_deps(doc: &mut toml_edit::Document) {
fn remove_private_crates(
doc: &mut toml_edit::Document,
metadata: &metadata::Metadata,
private_crates: &[&PathBuf],
private_crates: &[PathBuf],
) -> Result<()> {
let table = doc.as_table_mut();
if let Some(workspace) = table.get_mut("workspace").and_then(toml_edit::Item::as_table_like_mut)
Expand All @@ -209,7 +209,7 @@ fn remove_private_crates(
if let Some(member) = members.get(i).and_then(toml_edit::Value::as_str) {
let manifest_path =
metadata.workspace_root.join(member).join("Cargo.toml").canonicalize()?;
if private_crates.iter().any(|p| **p == manifest_path) {
if private_crates.iter().any(|p| *p == manifest_path) {
members.remove(i);
continue;
}
Expand Down

0 comments on commit a492990

Please sign in to comment.