Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 47fdc82

Browse files
committedMay 28, 2024·
Fix test
1 parent 11d5ef1 commit 47fdc82

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
 

‎opentelemetry-proto/tests/grpc_build.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,12 @@ fn build_content_map(path: impl AsRef<Path>, normalize_line_feed: bool) -> HashM
130130
.collect()
131131
}
132132

133-
/// Returns a String with the platform specific new line feed character.
133+
/// Returns a String which uses the platform specific new line feed character.
134134
fn get_platform_specific_string(input: String) -> String {
135-
if cfg!(windows) {
136-
input.replace('\n', "\r\n")
137-
} else {
138-
input
135+
if cfg!(windows) && !input.ends_with("\r\n") && input.ends_with('\n') {
136+
return input.replace('\n', "\r\n");
139137
}
138+
input
140139
}
141140

142141
fn ensure_files_are_same(

0 commit comments

Comments
 (0)