aboutsummaryrefslogtreecommitdiff
path: root/src/util/formatting.rs
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2021-10-16 13:02:59 +0200
committerMax Audron <audron@cocaine.farm>2021-10-16 13:41:52 +0200
commit08169250954d62d9145aa9b819000edd904e75a6 (patch)
treef809f9e16b6623789a72f1596e52ce87efe8b879 /src/util/formatting.rs
parentAlso quote_plus on API url input query string (diff)
make util functions world public
Diffstat (limited to 'src/util/formatting.rs')
-rw-r--r--src/util/formatting.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/formatting.rs b/src/util/formatting.rs
index add3f1b..c1b6257 100644
--- a/src/util/formatting.rs
+++ b/src/util/formatting.rs
@@ -1,7 +1,7 @@
/// Truncates a string after a certain number of characters.
/// Function always tries to truncate on a word boundary.
/// Reimplemented from gonzobot.
-pub(crate) fn truncate(text: &str, len: usize) -> String {
+pub fn truncate(text: &str, len: usize) -> String {
if text.len() <= len {
return text.to_string();
}
fix truncate on unicodeMax Audron-10/+20 2025-05-06update dependenciesMax Audron-691/+1659 2024-08-12add nix build and moduleMax Audron-5/+427 2022-02-19remove jsonnet lock fileMax Audron-36/+0 2022-02-19fix deploy to work with gitlab agentMax Audron-4/+4 2021-10-22write tons of documentation and reorganize some modulesMax Audron-65/+300 2021-10-22remove wolfram alpha url shorteningMax Audron-1/+2 2021-10-20remove failing wolfram alpha test casesMax Audron-105/+55 2021-10-20bump version to 1.6.2Max Audron-3/+2 2021-10-20prepare for release on crates.ioMax Audron-39/+65 2021-10-20add async docs to macro crate and bump versionMax Audron-9/+10 2021-10-20change hook errors to be logged as warningsMax Audron-3/+3 2021-10-20fix configuration not loading correctly on release buildsMax Audron-8/+23 2021-10-19replace sedregex crate8-rework-sedMax Audron-20/+358 2021-10-19add formatting trait for irc codesMax Audron-0/+129 2021-10-17fix links in readmeMax Audron-2/+2