mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-06 12:58:45 +08:00
19 lines
467 B
Rust
19 lines
467 B
Rust
mod fixed;
|
|
|
|
use crate::types::*;
|
|
|
|
pub fn fmt_message(mes: &mut Vec<Message>, opt: FormatOptions) {
|
|
match opt {
|
|
FormatOptions::Fixed {
|
|
length,
|
|
keep_original,
|
|
} => {
|
|
let formatter = fixed::FixedFormatter::new(length, keep_original);
|
|
for message in mes.iter_mut() {
|
|
message.message = formatter.format(&message.message);
|
|
}
|
|
}
|
|
FormatOptions::None => {}
|
|
}
|
|
}
|