Skip to content

Commit

Permalink
🚨 Fix legacy_random warning
Browse files Browse the repository at this point in the history
Legacy Random Violation: Prefer using `type.random(in:)` over legacy functions (legacy_random)
  • Loading branch information
Lucien committed Jul 8, 2024
1 parent f6447dc commit 1f56a6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/NadaADeclarar/Generator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extension Generatable {
let basicNumberLength = NumberParsedType.numberLength - NumberParsedType.checkDigitsCount
var randomNumber = ""
for _ in 0 ..< basicNumberLength {
randomNumber += String(arc4random() % 10)
randomNumber += String(Int.random(in: 0...9))
}
return randomNumber
}
Expand Down

0 comments on commit 1f56a6c

Please sign in to comment.