87f2a0cb75
Add Tests for Entries::{find_by_id_substr, find_by_id_startswith}
2019-09-01 13:36:39 +02:00
84135b1961
Add Entries::{find_by_id_substr, find_by_id_startswith}
...
This patch adds functions to the Entries type which can be used for
filtering by id, either with `contains()` or `starts_with()`.
This is useful for the end-user functionality where the user specifies
the ID of an entry only partially.
The implementation still iterates over all entries. This could be
improved, of course, by implementing a `find`-like function on `Store`
directly. But for now, this is good enough.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-09-01 13:36:39 +02:00
47044d9ffe
Pull changes from https://github.com/flip1995/imag clippy_fix
...
This pulls in the clippy fixes from Phil. From the request-pull:
-----8<-----
I finally got to fixing all of the Clippy warnings in the imag codebase.
`cargo test` passes, `cargo clippy` doesn't produce any warnings
or errors.
Some important notes:
- I didn't pay attention to the line length of the changes, so it may
have happened that some lines are now longer than 100 chars
- Except two commits the commit messages are formatted as follows:
* The first tag shows if the changes in the commit were
automatically applied by `cargo fix --clippy -Zunstable-options`.
Commits that were automatically applied may require closer review,
since I didn't check those by hand and the Clippy fix feature is
still unstable.
* The other tags specify the subcrate that is affected by the
commit. I created one commit for each subcrate, even when only one
file (most of the time the `main.rs` file) was changed.
- I created one commit, where I replace usages of `r#try!` with the
`?` operator, since `try!` is now officially deprecated.
- I created one commit, where I just allow Clippy lints. Either because
the fix would require much more work or knowledge of the codebase or
because it was a FP.
This was pretty much work, but it helped detecting a few bugs in Clippy,
where I was already able to open 3 or 4 PRs. So win-win I guess.
[...] we got a net LoC decrease.
----->8-----
2019-08-28 18:19:12 +02:00
flip1995
e2216db41d
Allow some Clippy lints
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
0087de7af8
[No-auto] lib/etc/interaction: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
a8bb180a6a
[No-auto] lib/entry/view: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
d377a999cb
[No-auto] lib/entry/util: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
d605f923bb
[No-auto] lib/entry/url: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
c8a7aacf99
[No-auto] lib/entry/tag: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
fae9f82c67
[No-auto] lib/entry/ref: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
69dce9ed9f
[No-auto] lib/entry/link: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
9620e81f59
[No-auto] lib/entry/filter: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
36957917b2
[No-auto] lib/entry/datetime: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
db40175840
[No-auto] lib/entry/category: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
2e7706af99
[No-auto] lib/domain/todo: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
4301e80cf2
[No-auto] lib/domain/timetrack: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
8726cb12cf
[No-auto] lib/domain/mail: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
6307b80027
[No-auto] lib/domain/habit: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
2ac2a86c7a
[No-auto] lib/domain/bookmark: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
b2997517bb
[No-auto] lib/core/store: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
7b5f216e01
[No-auto] lib/core/rt: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
daddea7adf
[No-auto] bin/domain/timetrack: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
4529ebf216
[No-auto] bin/domain/notes: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
3036d87402
[No-auto] bin/domain/mail: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
009539dfd3
[No-auto] bin/domain/log: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
3b941f23e3
[No-auto] bin/domain/habit: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
1bb6f452e9
[No-auto] bin/domain/diary: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
397bcd43d0
[No-auto] bin/domain/contact: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
7a97c02584
[No-auto] bin/domain/bookmark: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:41 +02:00
flip1995
42f6a3040d
[No-auto] bin/core/tag: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
a2d3a8cffc
[No-auto] bin/core/store: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
5b0817bcb6
[No-auto] bin/core/ref: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
4579187549
[No-auto] bin/core/grep: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
0befd68c95
[No-auto] bin/core/gps: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
20de35d91b
[No-auto] bin/core/git: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
d9d82d7441
[No-auto] bin/core/diagnostics: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
cba336e1dd
[No-auto] bin/core/category: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
846304e687
[No-auto] bin/core/annotate: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
3a1f0dde9d
[No-auto] bin/core/imag: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
670a0ff6d7
[Auto] lib/etc/util: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
bde29b7242
[Auto] lib/etc/interaction: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
cb9068d7fb
[Auto] lib/entry/view: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
19a1c41924
[Auto] lib/entry/url: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
1569442fee
[Auto] lib/entry/tag: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
c02e6580be
[Auto] lib/entry/ref: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
3215c6351c
[Auto] lib/entry/markdown: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
e2b1ed729a
[Auto] lib/entry/link: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
839f39435a
[Auto] lib/entry/gps: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
28e693bdea
[Auto] lib/entry/filter: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00
flip1995
17de341b90
[Auto] lib/entry/edit: Fix Clippy warnings
...
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-08-28 18:18:40 +02:00