mirror of
https://github.com/TaKO8Ki/gobang
synced 2024-10-31 03:20:33 +00:00
early return error
This commit is contained in:
parent
7cc4bb7eb1
commit
3c1e6d13e9
@ -86,13 +86,13 @@ impl DrawableComponent for ConnectionsComponent {
|
|||||||
let width = 80;
|
let width = 80;
|
||||||
let height = 20;
|
let height = 20;
|
||||||
let conns = &self.connections;
|
let conns = &self.connections;
|
||||||
let connections: Vec<ListItem> = conns
|
let mut connections: Vec<ListItem> = Vec::new();
|
||||||
.iter()
|
for c in conns {
|
||||||
.map(|i| {
|
connections.push(
|
||||||
ListItem::new(vec![Spans::from(Span::raw(i.database_url().unwrap()))])
|
ListItem::new(vec![Spans::from(Span::raw(c.database_url()?))])
|
||||||
.style(Style::default())
|
.style(Style::default()),
|
||||||
})
|
)
|
||||||
.collect();
|
}
|
||||||
let tasks = List::new(connections)
|
let tasks = List::new(connections)
|
||||||
.block(Block::default().borders(Borders::ALL).title("Connections"))
|
.block(Block::default().borders(Borders::ALL).title("Connections"))
|
||||||
.highlight_style(Style::default().bg(Color::Blue))
|
.highlight_style(Style::default().bg(Color::Blue))
|
||||||
|
Loading…
Reference in New Issue
Block a user