From fec434a4e2d0ff65510581e461d87a945d25759a Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Thu, 23 Oct 2025 10:17:00 +0300 Subject: Use serapeum's -> & defsubst --- src/tg/message-entity.lisp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/tg/message-entity.lisp') diff --git a/src/tg/message-entity.lisp b/src/tg/message-entity.lisp index 1a8cd27..c87dca0 100644 --- a/src/tg/message-entity.lisp +++ b/src/tg/message-entity.lisp @@ -3,6 +3,7 @@ (defpackage :ukkoclot/src/tg/message-entity (:documentation "MessageEntity Telegram type") (:use :c2cl :iterate :ukkoclot/src/enum :ukkoclot/src/tg/type-macros :ukkoclot/src/tg/user) + (:import-from :serapeum :->) (:export #:message-entity-type #:mention @@ -72,6 +73,7 @@ (unless (= char-code-limit #x110000) (error "Some UTF-16 fuckery assumes that system chars are UTF-32")) +(-> utf16-width (character) (member 1 2)) (defun utf16-width (ch) "Calculate the size of char in UTF-16 units." (declare (type character ch)) @@ -79,6 +81,7 @@ 1 2)) +(-> message-entity-extract (message-entity string) string) (defun message-entity-extract (entity text) "Extract the text corresponding to the ENTITY from the message text (in TEXT)." (check-type entity message-entity) -- cgit v1.2.3