Skip to content

Commit

Permalink
TODOs -> references to #168
Browse files Browse the repository at this point in the history
  • Loading branch information
yshavit authored Aug 9, 2024
1 parent cea49ef commit 34a2c84
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/fmt_md.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ impl<'s, 'md> MdWriterState<'s, 'md> {
MdElemRef::Paragraph(para) => self.write_paragraph(out, para),
MdElemRef::BlockQuote(block) => self.write_block_quote(out, block),
MdElemRef::List(list) => self.write_list(out, list),
MdElemRef::Table(table) => self.write_table(out, table.into()), // TODO maybe have a generic table trait, so I don't need to do the copying?
MdElemRef::Table(table) => {
// GH #168 maybe have a trait for tables, so we can parameterize write_table instead of calling into()?
// That would let us avoid copying various vecs.
self.write_table(out, table.into())
}
MdElemRef::TableSlice(table) => self.write_table(out, table),
MdElemRef::Inline(inline) => {
self.inlines_writer.write_inline_element(out, inline);
Expand Down
2 changes: 1 addition & 1 deletion src/select/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ impl MdqRefSelector {

fn build_output<'md>(&self, out: &mut Vec<MdElemRef<'md>>, node: MdElemRef<'md>) {
// try_select_node is defined in macro_helpers::selectors!
// GH #168 can we remove the clone()? Maybe by having try_select_node take a reference.
match self.try_select_node(node.clone()) {
// TODO can we remove this? I don't think so, but let's follow up
Some(found) => out.push(found),
None => {
for child in Self::find_children(node) {
Expand Down
2 changes: 1 addition & 1 deletion src/select/sel_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl TableSliceSelector {

impl<'md> Selector<'md, TableSlice<'md>> for TableSliceSelector {
fn try_select(&self, slice: TableSlice<'md>) -> Option<MdElemRef<'md>> {
let mut slice = slice.clone(); // TODO is there any way to avoid this? There may not be.
let mut slice = slice.clone(); // GH #168 is there any way to avoid this? There may not be.
slice.normalize();

slice.retain_columns_by_header(|line| self.headers_matcher.matches_inlines(line));
Expand Down

0 comments on commit 34a2c84

Please sign in to comment.