fix clippy warnings

pull/35/head
Takayuki Maeda 3 years ago
parent cb84883671
commit 834462b3dd

2
Cargo.lock generated

@ -333,7 +333,7 @@ dependencies = [
[[package]]
name = "database-tree"
version = "0.1.2"
version = "0.1.0"
dependencies = [
"anyhow",
"chrono",

@ -1,7 +1,7 @@
[package]
name = "database-tree"
version = "0.1.2"
authors = ["Stephan Dilly <dilly.stephan@gmail.com>"]
version = "0.1.0"
authors = ["Takayuki Maeda <takoyaki0316@gmail.com>"]
edition = "2018"
license = "MIT"
homepage = "https://github.com/TaKO8Ki/gobang"

@ -26,8 +26,8 @@ impl DatabaseTreeItems {
.iter()
.filter(|item| item.is_database() || item.is_match(&filter_text))
.map(|item| {
let mut item = item.clone();
if item.is_database() {
let mut item = item.clone();
item.set_collapsed(false);
item
} else {
@ -240,9 +240,8 @@ impl DatabaseTreeItems {
let item_kind = self.tree_items[i].kind().clone();
if matches!(item_kind, DatabaseTreeItemKind::Database{ collapsed, .. } if collapsed) {
inner_collapsed = Some(item_kind.clone());
} else if matches!(item_kind, DatabaseTreeItemKind::Schema{ collapsed, .. } if collapsed)
if matches!(item_kind, DatabaseTreeItemKind::Database{ collapsed, .. } if collapsed)
|| matches!(item_kind, DatabaseTreeItemKind::Schema{ collapsed, .. } if collapsed)
{
inner_collapsed = Some(item_kind.clone());
}

@ -74,12 +74,12 @@ impl Pool for PostgresPool {
t.schema
.as_ref()
.map(|schema| schema.to_string())
.unwrap_or("".to_string())
.unwrap_or_else(|| "".to_string())
}) {
schemas.push(
Schema {
name: key,
tables: group.map(|g| g.clone()).collect(),
tables: group.cloned().collect(),
}
.into(),
)

Loading…
Cancel
Save