Skip to content

Commit cd2af50

Browse files
DaveEwinghamishknight
authored andcommitted
From review: use raw strings for find/replace when quoting a string.
1 parent 870adfa commit cd2af50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/_StringProcessing/PrintAsPattern.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ extension PrettyPrinter {
576576
extension String {
577577
// TODO: Escaping?
578578
fileprivate var _quoted: String {
579-
"\"\(self._replacing("\\", with: "\\\\")._replacing("\"", with: "\\\""))\""
579+
"\"\(self._replacing(#"\"#, with: #"\\"#)._replacing(#"""#, with: #"\""#))\""
580580
}
581581
}
582582

0 commit comments

Comments
 (0)