From 26187d98b7993d9bc0ad8be5d830367c8365f319 Mon Sep 17 00:00:00 2001 From: CMK Date: Fri, 7 May 2021 18:42:49 +0800 Subject: [PATCH] chore: renaming interface --- Mastodon/Helper/MastodonStatusContent.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mastodon/Helper/MastodonStatusContent.swift b/Mastodon/Helper/MastodonStatusContent.swift index 284b726a..0f9dbc6c 100755 --- a/Mastodon/Helper/MastodonStatusContent.swift +++ b/Mastodon/Helper/MastodonStatusContent.swift @@ -65,7 +65,7 @@ enum MastodonStatusContent { var trimmed = text for activeEntity in activeEntities { - MastodonStatusContent.trimEntity(toot: &trimmed, activeEntity: activeEntity, activeEntities: activeEntities) + MastodonStatusContent.trimEntity(status: &trimmed, activeEntity: activeEntity, activeEntities: activeEntities) } return ParseResult( @@ -76,7 +76,7 @@ enum MastodonStatusContent { ) } - static func trimEntity(toot: inout String, activeEntity: ActiveEntity, activeEntities: [ActiveEntity]) { + static func trimEntity(status: inout String, activeEntity: ActiveEntity, activeEntities: [ActiveEntity]) { let text: String let trimmed: String switch activeEntity.type { @@ -91,8 +91,8 @@ enum MastodonStatusContent { } guard let index = activeEntities.firstIndex(where: { $0.range == activeEntity.range }) else { return } - guard let range = Range(activeEntity.range, in: toot) else { return } - toot.replaceSubrange(range, with: trimmed) + guard let range = Range(activeEntity.range, in: status) else { return } + status.replaceSubrange(range, with: trimmed) let offset = trimmed.count - text.count activeEntity.range.length += offset