[fractal] fractal-matrix-api: Drop redundant field initializations
- From: Alexandre Franke <afranke src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal] fractal-matrix-api: Drop redundant field initializations
- Date: Sun, 23 Dec 2018 11:06:39 +0000 (UTC)
commit 14e7d2fcf5ec37c88f12d129a98762295e7c945f
Author: Zeeshan Ali <zeenix collabora co uk>
Date: Mon Dec 10 17:15:41 2018 +0100
fractal-matrix-api: Drop redundant field initializations
Fixing clippy error:
```
error: redundant field names in struct initialization
--> fractal-matrix-api/src/backend/mod.rs:47:13
|
47 | tx: tx,
| ^^^^^^ help: replace it with: `tx`
|
= note: `-D clippy::redundant-field-names` implied by `-D warnings`
= help: for further information visit
https://rust-lang-nursery.github.io/rust-clippy/master/index.html#redundant_field_names
error: redundant field names in struct initialization
--> fractal-matrix-api/src/model/room.rs:37:13
|
37 | id: id,
| ^^^^^^ help: replace it with: `id`
|
= help: for further information visit
https://rust-lang-nursery.github.io/rust-clippy/master/index.html#redundant_field_names
error: redundant field names in struct initialization
--> fractal-matrix-api/src/model/room.rs:38:13
|
38 | name: name,
| ^^^^^^^^^^ help: replace it with: `name`
|
= help: for further information visit
https://rust-lang-nursery.github.io/rust-clippy/master/index.html#redundant_field_names
```
Related: #370
fractal-matrix-api/src/backend/mod.rs | 2 +-
fractal-matrix-api/src/model/room.rs | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/fractal-matrix-api/src/backend/mod.rs b/fractal-matrix-api/src/backend/mod.rs
index bf1cea5..56f349f 100644
--- a/fractal-matrix-api/src/backend/mod.rs
+++ b/fractal-matrix-api/src/backend/mod.rs
@@ -44,7 +44,7 @@ impl Backend {
m_direct: HashMap::new(),
};
Backend {
- tx: tx,
+ tx,
internal_tx: None,
data: Arc::new(Mutex::new(data)),
user_info_cache: CacheMap::new().timeout(60 * 60),
diff --git a/fractal-matrix-api/src/model/room.rs b/fractal-matrix-api/src/model/room.rs
index dab313c..ece0a64 100644
--- a/fractal-matrix-api/src/model/room.rs
+++ b/fractal-matrix-api/src/model/room.rs
@@ -34,8 +34,8 @@ pub struct Room {
impl Room {
pub fn new(id: String, name: Option<String>) -> Room {
Room {
- id: id,
- name: name,
+ id,
+ name,
avatar: None,
topic: None,
alias: None,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]