File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Tests/YMatterTypeTests/Extensions/Foundation Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -128,9 +128,7 @@ extension NSMutableAttributedString {
128128 /// - subtext: text within the attributed string to add the attributes.
129129 func addAttributes( _ attributes: [ NSAttributedString . Key : Any ] , to subtext: String ) {
130130 guard let range = string. range ( of: subtext) else { return }
131-
132- let safeText = NSString ( string: subtext) as String
133- addAttributes ( attributes, range: NSRange ( range, in: safeText) )
131+ addAttributes ( attributes, range: NSRange ( range, in: string) )
134132 }
135133
136134 /// Sets attributes to the first range of text matching `subtext`.
@@ -142,8 +140,6 @@ extension NSMutableAttributedString {
142140 /// - subtext: text within the attributed string to set the attributes.
143141 func setAttributes( _ attributes: [ NSAttributedString . Key : Any ] , to subtext: String ) {
144142 guard let range = string. range ( of: subtext) else { return }
145-
146- let safeText = NSString ( string: subtext) as String
147- setAttributes ( attributes, range: NSRange ( range, in: safeText) )
143+ setAttributes ( attributes, range: NSRange ( range, in: string) )
148144 }
149145}
You can’t perform that action at this time.
0 commit comments