- Fix the search results not expanding
- Fix the spacing around the searchbar
The two UI files are identical except for some labels and IDs and should
be merged
This fixes this errors from clippy:
```
warning: use of `unwrap_or` followed by a call to `new`
--> fractal-matrix-api/src/backend/room.rs:80:30
|
80 | avatar = util::get_room_avatar(&baseu, &tk, &userid, &roomid)
| ______________________________^
81 | | .unwrap_or(String::from(""));
| |_________________________________________________^ help: try this: `util::get_room_avatar(&baseu, &tk, &userid, &roomid).unwrap_or_default()`
|
= note: #[warn(clippy::or_fun_call)] on by default
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#or_fun_call
```
Related: #370
This fixes this errors from clippy:
```
error: single-character string constant used as pattern
--> fractal-matrix-api/src/backend/media.rs:119:30
|
119 | let name = url.split("/").last().unwrap_or_default();
| ^^^ help: try using a char instead: `'/'`
|
= note: `-D clippy::single-char-pattern` implied by `-D warnings`
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#single_char_pattern
```
Related: #370
This fixes some errors from clippy about needless length comparison to 0:
```
error: length comparison to zero
--> fractal-matrix-api/src/util.rs:483:27
|
483 | if array.is_none() || array.unwrap().len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `array.unwrap().is_empty()`
|
= note: `-D clippy::len-zero` implied by `-D warnings`
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#len_zero
```
Related: #370
This patch fixes a big bunch of 'unnecessary pass by value' errors from clippy:
```
error: this argument is passed by value, but not consumed in the function body
--> fractal-matrix-api/src/util.rs:340:9
|
340 | tk: String,
| ^^^^^^
|
= note: `-D clippy::needless-pass-by-value` implied by `-D warnings`
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#needless_pass_by_value
help: consider changing the type to
|
340 | tk: &str,
| ^^^^
help: change `tk.clone()` to
|
357 | tk.to_string(),
| ^^^^^^^^^^^^^^
```
Related: #370
Fixing clippy error:
```
error: called `map(f)` on an Option value where `f` is a unit closure
--> fractal-matrix-api/src/util.rs:248:17
|
248 | / fread["content"]["event_id"]
249 | | .as_str()
250 | | .map(|ev| r.add_receipt_from_fully_read(userid, ev));
| |________________________________________________________________________^
|
= note: `-D clippy::option-map-unit-fn` implied by `-D warnings`
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#option_map_unit_fn
help: try this
|
248 | if let Some(ev) = fread["content"]["event_id"]
249 | .as_str() { r.add_receipt_from_fully_read(userid, ev) }
|
```
Related: #370
Fixing clippy error:
```
error: for loop over `dataevs.as_array()`, which is an `Option`. This is more readably written as an `if let` statement.
--> fractal-matrix-api/src/util.rs:221:19
|
221 | for ev in dataevs.as_array() {
| ^^^^^^^^^^^^^^^^^^
|
= note: #[deny(clippy::for_loop_over_option)] on by default
= help: consider replacing `for ev in dataevs.as_array()` with `if let Some(ev) = dataevs.as_array()`
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/master/index.html#for_loop_over_option
```
Related: #370