Skip to content

Read the original file for comparing/detecting newline#4236

Merged
topecongiro merged 1 commit into
rust-lang:masterfrom
topecongiro:windows-newline-issues
Jun 7, 2020
Merged

Read the original file for comparing/detecting newline#4236
topecongiro merged 1 commit into
rust-lang:masterfrom
topecongiro:windows-newline-issues

Conversation

@topecongiro
Copy link
Copy Markdown
Contributor

Close #4097.

@topecongiro topecongiro force-pushed the windows-newline-issues branch from bbe7fa1 to 0cf74df Compare June 6, 2020 08:39
Comment thread src/formatting.rs
std::io::Error::from(std::io::ErrorKind::InvalidInput),
))?)?,
};
apply_newline_style(config.newline_style(), &mut visitor.buffer, &original_text);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to pass the original file content to apply_newline_style.

)
}

pub(crate) fn get_original_snippet(&self, file_name: &FileName) -> Option<Rc<String>> {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is no longer used, and thus removed.

Comment thread src/formatting/visitor.rs
}
}

pub(crate) fn entire_snippet(&self) -> &str {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is no longer used, and thus removed.

Copy link
Copy Markdown
Member

@calebcartwright calebcartwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@topecongiro topecongiro merged commit a441d5e into rust-lang:master Jun 7, 2020
@topecongiro topecongiro deleted the windows-newline-issues branch June 7, 2020 02:46
@calebcartwright calebcartwright added 1x-backport:pending Fixed/resolved in source but not yet backported to a 1x branch and release and removed backport-triage labels May 29, 2022
@ytmimi ytmimi mentioned this pull request Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1x-backport:pending Fixed/resolved in source but not yet backported to a 1x branch and release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Newline style changes to Unix-style when file is modified

3 participants