aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/utils
diff options
context:
space:
mode:
authorcategorille <69397914+categorille@users.noreply.github.com>2021-02-17 15:55:09 +0100
committerGitHub <noreply@github.com>2021-02-17 15:55:09 +0100
commit6e5607ba26d8c1daa384d9eb8c6e138b68360d02 (patch)
treeff7cbeaa74dba9692d224f77f6ad5a7fb8a0ac77 /src/common/utils
parentinfra(simplify build and install) (diff)
downloadsl0ppij-6e5607ba26d8c1daa384d9eb8c6e138b68360d02.tar.gz
sl0ppij-6e5607ba26d8c1daa384d9eb8c6e138b68360d02.tar.xz
sl0ppij-6e5607ba26d8c1daa384d9eb8c6e138b68360d02.zip
docs: first documentation step (#185)
* added some documentation to the input module * added a bunch of documentation already, doing this non-linearly * added more comments * forgot cargo ftm again oop * PR change requests applied, some forgotten/imcomplete doc added
Diffstat (limited to 'src/common/utils')
-rw-r--r--src/common/utils/consts.rs2
-rw-r--r--src/common/utils/logging.rs2
-rw-r--r--src/common/utils/mod.rs2
-rw-r--r--src/common/utils/shared.rs4
4 files changed, 9 insertions, 1 deletions
diff --git a/src/common/utils/consts.rs b/src/common/utils/consts.rs
index c4a75158..fa9eee0d 100644
--- a/src/common/utils/consts.rs
+++ b/src/common/utils/consts.rs
@@ -1,3 +1,5 @@
+//! Zellij program-wide constants.
+
pub const ZELLIJ_TMP_DIR: &str = "/tmp/zellij";
pub const ZELLIJ_TMP_LOG_DIR: &str = "/tmp/zellij/zellij-log";
pub const ZELLIJ_TMP_LOG_FILE: &str = "/tmp/zellij/zellij-log/log.txt";
diff --git a/src/common/utils/logging.rs b/src/common/utils/logging.rs
index c568cd56..d08639aa 100644
--- a/src/common/utils/logging.rs
+++ b/src/common/utils/logging.rs
@@ -1,3 +1,5 @@
+//! Zellij logging utility functions.
+
use std::{
fs,
io::{self, prelude::*},
diff --git a/src/common/utils/mod.rs b/src/common/utils/mod.rs
index 0ea4c76f..1cb4df27 100644
--- a/src/common/utils/mod.rs
+++ b/src/common/utils/mod.rs
@@ -1,3 +1,5 @@
+//! Zellij utilities.
+
pub mod consts;
pub mod logging;
pub mod shared;
diff --git a/src/common/utils/shared.rs b/src/common/utils/shared.rs
index 1d8ca5c3..9717837a 100644
--- a/src/common/utils/shared.rs
+++ b/src/common/utils/shared.rs
@@ -1,8 +1,10 @@
+//! Some general utility functions.
+
use std::{iter, str::from_utf8};
use strip_ansi_escapes::strip;
-pub fn ansi_len(s: &str) -> usize {
+fn ansi_len(s: &str) -> usize {
from_utf8(&strip(s.as_bytes()).unwrap())
.unwrap()
.chars()