fix type error

pull/129/head
susiyaki 3 years ago
parent 7fc5d690e0
commit 143350edcc

@ -89,7 +89,7 @@ impl StatefulDrawableComponent for ConnectionsComponent {
let mut connections: Vec<ListItem> = Vec::new();
for c in conns {
connections.push(
ListItem::new(vec![Spans::from(Span::raw(c.database_url_with_name()))])
ListItem::new(vec![Spans::from(Span::raw(c.database_url_with_name()?))])
.style(Style::default()),
)
}

@ -267,17 +267,17 @@ impl Connection {
}
}
pub fn database_url_with_name(&self) -> std::string::String {
pub fn database_url_with_name(&self) -> anyhow::Result<String> {
let database_url = self.database_url()?;
match &self.name {
Ok(match &self.name {
Some(name) => format!(
"[{name}] {database_url}",
name = name,
database_url = database_url
),
None => database_url,
}
})
}
pub fn is_mysql(&self) -> bool {

Loading…
Cancel
Save