From e6dabe61d0903390a5f671032012300873230bc3 Mon Sep 17 00:00:00 2001 From: Aleksandr Date: Fri, 20 Dec 2024 15:06:30 +0300 Subject: [PATCH] chore(dumper): docs --- elfo-dumper/src/config.rs | 3 +++ elfo-dumper/src/config/dump_path.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/elfo-dumper/src/config.rs b/elfo-dumper/src/config.rs index 1fcb247..d698f05 100644 --- a/elfo-dumper/src/config.rs +++ b/elfo-dumper/src/config.rs @@ -43,6 +43,9 @@ pub struct Config { /// A path to a dump file or template: /// * `path/all.dump` - one file. /// * `path/{class}.dump` - file per class. + /// * `path/{time:}.dump` - file per dump time. The `` + /// refers to the time format as in strftime: + /// (`man strftime(3)`). pub path: DumpPath, /// How often dumpers should write dumps to files. /// `500ms` by default. diff --git a/elfo-dumper/src/config/dump_path.rs b/elfo-dumper/src/config/dump_path.rs index 8ca5207..e3b48a9 100644 --- a/elfo-dumper/src/config/dump_path.rs +++ b/elfo-dumper/src/config/dump_path.rs @@ -190,7 +190,7 @@ enum Variable { /// Time of the dump. Time { - /// strptime string format. + /// strftime string format. format: cstr::Utf8CString, }, } @@ -241,7 +241,7 @@ fn strftime(ts: i64, format: &cstr::Utf8CString, dest: &mut String) -> bool { unsafe { // 1. mem::transmute wouldn't compile if u8 and libc::c_char differ in size // (there are strange circumstances). - // 2. `libc::c_char` to i8 is i8 -> u8 conversion, thus converting + // 2. `libc::c_char` to u8 is i8 -> u8 conversion, thus converting // same-sized arrays through transmute is safe (btw transmute checks that // condition in compile time) let u8_array = std::mem::transmute::<