Skip to content

Commit

Permalink
chore: missing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-coye committed Jun 7, 2023
1 parent 377f720 commit b4e9e41
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion MailCore/Models/Message.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ public extension String {

/// Truncate a string for compatibility with Realm if needed
///
/// the string will be terminated by " [truncated]" if it was
/// The string will be terminated by " [truncated]" if it was
var truncatedForRealmIfNeeded: Self {
Self.truncatedForRealmIfNeeded(self)
}

/// Truncate a string for compatibility with Realm if needed
///
/// The string will be terminated by " [truncated]" if it was
/// - Parameter input: an input string
/// - Returns: The output string truncated if needed
static func truncatedForRealmIfNeeded(_ input: String) -> String {
if input.utf8.count > Self.closeToMaxRealmSize {
let index = input.index(input.startIndex, offsetBy: Self.closeToMaxRealmSize)
Expand Down

0 comments on commit b4e9e41

Please sign in to comment.