table_data => table_row

This commit is contained in:
David Peter authored and David Peter committed 2022-05-15 21:37:40 +02:00
1 parent 7fdb32d202
commit 5cd2821266
2 files changed
+7 -8

No files matched your search

+2 -3
View File
@@ -4,7 +4,7 @@ use crate::export::markup::MarkupExporter;
pub struct MarkdownExporter {}
impl MarkupExporter for MarkdownExporter {
fn table_data(&self, data: &[&str]) -> String {
fn table_row(&self, data: &[&str]) -> String {
format!("| {} |\n", data.join(" | "))
}
@@ -21,9 +21,8 @@ impl MarkupExporter for MarkdownExporter {
#[test]
fn test_markdown_formatter_table_data() {
let formatter = MarkdownExporter::default();
let data = vec!["a", "b", "c"];
let actual = formatter.table_data(&data);
let actual = formatter.table_row(&["a", "b", "c"]);
let expect = "| a | b | c |\n";
assert_eq!(expect, actual);