Skip to content

Commit

Permalink
Fixed deprecation warning for .characters in String Conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Brody committed Dec 5, 2017
1 parent e3879c5 commit 2b49754
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sources/String Conversion.swift
Expand Up @@ -94,11 +94,11 @@ extension BigInt {
init?(_ text: Substring, radix: Int = 10) {
var text = text
var sign: Sign = .plus
if text.characters.first == "-" {
if text.first == "-" {
sign = .minus
text = text.dropFirst()
}
else if text.characters.first == "+" {
else if text.first == "+" {
text = text.dropFirst()
}
guard let magnitude = BigUInt(text, radix: radix) else { return nil }
Expand Down Expand Up @@ -143,7 +143,7 @@ extension String {
self = ""
var first = true
for part in parts.reversed() {
let zeroes = charsPerWord - part.characters.count
let zeroes = charsPerWord - part.count
assert(zeroes >= 0)
if !first && zeroes > 0 {
// Insert leading zeroes for mid-Words
Expand Down

0 comments on commit 2b49754

Please sign in to comment.