Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add space to comments #8476

Merged
merged 2 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cargo/ops/cargo_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,12 +524,12 @@ impl IgnoreList {
_ => &self.ignore,
};

let mut out = "\n\n#Added by cargo\n".to_string();
let mut out = "\n\n# Added by cargo\n".to_string();
if ignore_items
.iter()
.any(|item| existing_items.contains(item))
{
out.push_str("#\n#already existing elements were commented out\n");
out.push_str("#\n# already existing elements were commented out\n");
}
out.push('\n');

Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ fn simple_git_ignore_exists() {
contents,
"/target\n\
**/some.file\n\n\
#Added by cargo\n\
# Added by cargo\n\
#\n\
#already existing elements were commented out\n\
# already existing elements were commented out\n\
\n\
#/target\n\
Cargo.lock\n",
Expand All @@ -108,7 +108,7 @@ fn git_ignore_exists_no_conflicting_entries() {
assert_eq!(
contents,
"**/some.file\n\n\
#Added by cargo\n\
# Added by cargo\n\
\n\
/target\n\
Cargo.lock\n",
Expand Down