From 9e7c8dfab25da9beb86fd4ed4115895eedb4c8ab Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Sat, 18 Oct 2025 08:42:44 +0300 Subject: Replace bunch of our string utilities with str library --- src/tg/method-macros.lisp | 6 +++--- src/tg/type-macros.lisp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/tg') diff --git a/src/tg/method-macros.lisp b/src/tg/method-macros.lisp index b924e15..0be6f00 100644 --- a/src/tg/method-macros.lisp +++ b/src/tg/method-macros.lisp @@ -6,8 +6,8 @@ (:import-from :alexandria :with-gensyms) (:import-from :com.dieggsy.f-string :enable-f-strings) (:import-from :serapeum :take) + (:import-from :str) (:import-from :ukkoclot/state :bot) - (:import-from :ukkoclot/strings :ends-with :lisp->camel-case) (:import-from :ukkoclot/transport :do-call) (:export :define-tg-method)) (in-package :ukkoclot/tg/method-macros) @@ -36,8 +36,8 @@ (collect (apply #'make-param param-spec)))) (defun path-from-name (name) - (let ((str (lisp->camel-case (symbol-name name)))) - (if (ends-with str "%") + (let ((str (str:camel-case name))) + (if (str:ends-with-p "%" str :ignore-case nil) (take (- (length str) 1) str) str))) diff --git a/src/tg/type-macros.lisp b/src/tg/type-macros.lisp index 5f99cba..75afab0 100644 --- a/src/tg/type-macros.lisp +++ b/src/tg/type-macros.lisp @@ -5,9 +5,9 @@ (:use :c2cl :iterate) (:import-from :alexandria :with-gensyms) (:import-from :com.dieggsy.f-string :enable-f-strings) + (:import-from :str) (:import-from :ukkoclot/serializing :parse-value) (:import-from :ukkoclot/hash-tables :gethash-lazy) - (:import-from :ukkoclot/strings :lisp->snake-case) (:local-nicknames (:jzon :com.inuoe.jzon)) (:export :define-tg-type)) @@ -39,7 +39,7 @@ (intern (concatenate 'string (symbol-name name) "-" (symbol-name (field-name field))))) (defun field-hash-key (field) - (string-downcase (lisp->snake-case (symbol-name (field-name field))))) + (str:snake-case (field-name field))) (defun field-keyword (field) (intern (symbol-name (field-name field)) :keyword)) -- cgit v1.2.3