Commit graph

58 commits

Author SHA1 Message Date
e7bd43718d Remove duplicated is_tag() function implementation 2017-07-19 00:31:27 +02:00
d3ddf929b6 Move utility functionality for tests into libimagutil 2017-07-18 23:47:23 +02:00
795df63679 Add missing license headers 2017-06-07 20:45:38 +02:00
d0d1f6add2 Remove libimagutil::ismatch module 2017-05-04 15:57:23 +02:00
f3287cc389 Remove unused keyword "mut" 2017-04-22 12:51:59 +02:00
Matthew Piziak
9fa115500d Simplify FoldResult implementation
- Add tests for FoldResult
- Make documentation more explicit
- Assert failure accumulator in test

Submitted-by: Matthew Piziak <matthew.piziak@gmail.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2017-04-21 21:08:38 +02:00
b59fcdffcd Fix backwards-incompatibilities of regex crate 2017-01-30 09:42:45 +01:00
Steven Allen
c02d7693b2 Don't re-open temporary file.
`Write` is implemented on both `&NamedTemporaryFile` and `&File` so you don't
actually need a mutable reference. I wish there were a better way to do this but
such is life.
2016-11-03 20:21:31 -07:00
30875d153f Merge pull request #771 from matthiasbeyer/clap-validators
Clap validators
2016-10-07 19:45:49 +02:00
0a70ea68ea libimagutil: Add copyright notice to all files 2016-10-01 17:35:06 +02:00
f8ed44c1e7 Add cli validator: is_existing_path() 2016-09-30 10:47:11 +02:00
d6f705dc90 Add is_tag clap validator helper 2016-09-30 10:45:28 +02:00
11490b232c Add implementation for validators 2016-09-28 19:30:05 +02:00
7482ffb5b3 Add deps 2016-09-28 19:30:04 +02:00
719e49271c Add module: cli_validators 2016-09-28 19:30:04 +02:00
7a23097b00 Add dependencies 2016-09-28 19:30:04 +02:00
027fffb5b5 Move edit_entry_with_cmd() to libimagutil 2016-09-09 16:33:14 +02:00
7bf654158e Merge pull request #695 from matthiasbeyer/libimagutil/warn-exit
libimagutil: Add warn_exit() convenience helper
2016-09-05 19:24:01 +02:00
b2f764d004 Add warn_exit() convenience helper 2016-09-05 16:15:50 +02:00
ec9da007a5 Add comment for warn_result code 2016-09-05 16:15:45 +02:00
87e170df72 Add comment for info_result code 2016-09-05 16:15:45 +02:00
2c89de1332 Add comment for debug_result code 2016-09-05 16:15:45 +02:00
6b6e3a0e12 Add documentation for the code-generator macro 2016-09-05 16:15:45 +02:00
7257f2cda1 Add libimagutil::warn_result::* 2016-08-28 14:31:29 +02:00
d050be4cbc Refactor, generate code with macro 2016-07-30 11:57:42 +02:00
deb1544bc5 Add info_result 2016-07-30 11:45:31 +02:00
0b1ea94dae Add utility to print debugging information while mapping 2016-07-29 16:49:45 +02:00
John Sirois
7f57e5e234 Move from a helper function to a typeclass.
This introduces the `FoldResut` trait to move from `func(receiver, ...)`
style to `receiver.func(...)` style. Also add a means to pass the
default result explicitly.
2016-07-14 07:28:54 -06:00
John Sirois
2c40b8734e Add a fold_ok utility.
Add a utility that folds an iterator into a result and uses it to reduce
boilerplate in the codebase.
2016-07-13 12:43:04 -06:00
1c723a9a0e Move trace_error() functionality from libimagutil to libimagerror 2016-05-17 20:28:02 +02:00
f22624302c Make trace() output red 2016-05-15 17:47:01 +02:00
5dd0fa900c Add dependency: ansi_term = 0.7 2016-05-15 17:46:52 +02:00
11021906b3 Merge pull request #401 from matthiasbeyer/libimagutil/code-cleanup
Code cleanup in libimagutil
2016-05-15 13:58:57 +02:00
e66d837642 Remove unneeded scopes 2016-05-14 19:51:24 +02:00
Andre Bogus
981707c9c9 more style adaptations
again following clippy
2016-05-13 22:27:53 +02:00
f6e59c355e Remove "caused by" marker
As we are in debug mode anyways, a developer using this should know by
the trace number that the next line is the cause.

As we use the debug!() macro here, this would be printed on a new line,
which is rather distracting instead of helpful. Therefor this patch
removes this line.
2016-04-22 15:10:24 +02:00
ad4e73399f Make trace() output a bit nicer 2016-04-21 16:36:13 +02:00
7bcff48286 Enable lints 2016-04-16 22:31:51 +02:00
a636040907 Use unused results by calling write!() with .ok() 2016-04-16 22:31:42 +02:00
8657d401cb Add another missing newline character 2016-03-25 13:29:59 +01:00
cd6e000be8 trace: Add missing newline 2016-03-12 16:06:10 +01:00
501f4f3111 Merge pull request #203 from matthiasbeyer/libimagutil/ismatch-util
Add ismatch!() macro
2016-03-07 17:22:13 +01:00
a429e872e1 Add ismatch!() macro 2016-02-21 11:44:39 +01:00
1b8838bf1f use lazy_static so we do not compile regex multiple times 2016-02-20 21:10:22 +01:00
0a8eaa1411 Add documentation of functions 2016-02-11 15:48:41 +01:00
d8ae741f31 Add error tracing utility 2016-02-11 15:48:41 +01:00
78cda89524 Add dependency: log = 0.3.5 2016-02-11 15:48:39 +01:00
e3daf7c853 tests: Allow quotes in keys 2016-01-29 23:11:42 +01:00
db38713977 Adapt test: single quoted 2016-01-29 23:11:42 +01:00
448c69891e Reimplement IntoKeyValue for String
* Double quotes should not be in the result
* Regex allows quotes in strings now
2016-01-29 23:11:42 +01:00