mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-26 03:31:12 +08:00
docs: 添加 Rustdoc 注释
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
use crate::bench::metrics::MetricCollection;
|
||||
|
||||
/// 把结果序列化为美观 JSON 字符串。
|
||||
pub fn format_json(results: &[MetricCollection]) -> String {
|
||||
serde_json::to_string_pretty(results).unwrap_or_else(|e| format!("{{\"error\": \"{}\"}}", e))
|
||||
}
|
||||
|
||||
/// 把结果格式化为对齐的文本表格(供终端打印)。
|
||||
pub fn format_text_table(results: &[MetricCollection]) -> String {
|
||||
let mut out = String::new();
|
||||
out.push_str(&format!(
|
||||
|
||||
Reference in New Issue
Block a user