From b4e9e4106515f2ad9cc2a63a37869e20b8647041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Coye=20de=20Brune=CC=81lis?= Date: Wed, 7 Jun 2023 14:17:43 +0200 Subject: [PATCH] chore: missing documentation --- MailCore/Models/Message.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MailCore/Models/Message.swift b/MailCore/Models/Message.swift index ba05bdab4..386bd3f79 100644 --- a/MailCore/Models/Message.swift +++ b/MailCore/Models/Message.swift @@ -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)