Skip to content

Commit

Permalink
fix: minor fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Mar 24, 2024
1 parent cb55dc0 commit 8affa1a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/rust/merged_ultraslim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub enum DataType {

#[derive(Deserialize)]
pub struct Link {
pub a: String,
pub a: Option<String>,
pub u: usize,
pub t: DataType,
}
Expand Down Expand Up @@ -62,11 +62,16 @@ impl MergedUltraSlim {
| (search_type == SearchType::MariaDB && link.t == DataType::MariaDB)
});
match found {
Some(link) => Ok(format!(
"{}#{}",
self.urls.get(link.u).expect("Url to exist in table"),
link.a,
)),
Some(link) => Ok(match &link.a {
Some(anchor) => format!(
"{}#{}",
self.urls.get(link.u).expect("Url to exist in table"),
anchor,
),
None => {
format!("{}", self.urls.get(link.u).expect("Url to exist in table"),)
}
}),
None => Err(SearchError {}),
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/rust/mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,11 @@ pub fn extract_mysql_from_text(qr: QueryResponse) -> Vec<KbParsedEntry> {
Some(tbody) => tbody
.find(Name("tr"))
.map(|tr| process_summary_table_row(tr))
.filter(|e| e.name.is_some())
.filter(|e| match &e.name {
Some(name) => name.starts_with("--") == false,
None => false,
})
.collect::<Vec<KbParsedEntry>>(),
None => vec![],
},
Expand Down

0 comments on commit 8affa1a

Please sign in to comment.