summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.imag-documentation/Cargo.toml3
-rw-r--r--.travis.yml1
-rw-r--r--Cargo.toml55
-rw-r--r--README.md151
-rw-r--r--bin/Cargo.toml12
-rw-r--r--bin/build.rs90
-rw-r--r--imag-bookmark/Cargo.toml3
-rw-r--r--imag-counter/Cargo.toml3
-rw-r--r--imag-diary/Cargo.toml3
-rw-r--r--imag-link/Cargo.toml3
-rw-r--r--imag-link/src/main.rs149
-rw-r--r--imag-notes/Cargo.toml3
-rw-r--r--imag-ref/Cargo.toml3
-rw-r--r--imag-store/Cargo.toml3
-rw-r--r--imag-tag/Cargo.toml3
-rw-r--r--imag-todo/Cargo.toml3
-rw-r--r--imag-view/Cargo.toml3
-rw-r--r--libimagbookmark/Cargo.toml3
-rw-r--r--libimagcounter/Cargo.toml3
-rw-r--r--libimagdiary/Cargo.toml3
-rw-r--r--libimagentryfilter/Cargo.toml3
-rw-r--r--libimagentrylink/Cargo.toml3
-rw-r--r--libimagentrylist/Cargo.toml3
-rw-r--r--libimagentrymarkdown/Cargo.toml3
-rw-r--r--libimagentrytag/Cargo.toml3
-rw-r--r--libimagentrytag/src/tagable.rs33
-rw-r--r--libimagentryview/Cargo.toml3
-rw-r--r--libimagerror/Cargo.toml3
-rw-r--r--libimaginteraction/Cargo.toml3
-rw-r--r--libimagnotes/Cargo.toml3
-rw-r--r--libimagref/Cargo.toml3
-rw-r--r--libimagref/src/reference.rs4
-rw-r--r--libimagrt/Cargo.toml3
-rw-r--r--libimagstore/Cargo.toml3
-rw-r--r--libimagstore/src/storeid.rs8
-rw-r--r--libimagstorestdhook/Cargo.toml3
-rw-r--r--libimagtimeui/Cargo.toml3
-rw-r--r--libimagtodo/Cargo.toml3
-rw-r--r--libimagutil/Cargo.toml3
-rw-r--r--libimagutil/src/edit.rs3
40 files changed, 394 insertions, 202 deletions
diff --git a/.imag-documentation/Cargo.toml b/.imag-documentation/Cargo.toml
index 5807018..217538f 100644
--- a/.imag-documentation/Cargo.toml
+++ b/.imag-documentation/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
[dependencies.libimagbookmark]
diff --git a/.travis.yml b/.travis.yml
index 365c997..e7098cb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,6 +20,7 @@ before_script:
export PATH=$HOME/.local/bin:$PATH
script:
- |
+ export RUSTFLAGS="-C codegen-units=2"
if [[ "$TEST_SUITE" == "binaries" ]]; then
make bin-test
else # $TEST_SUITE == "libraries"
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 0000000..1f9ee61
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,55 @@
+[package]
+name = "imag"
+version = "0.2.0"
+authors = ["Matthias Beyer <mail@beyermatthias.de>"]
+
+description = "Personal information management (PIM) suite"
+keywords = ["pim", "personal", "information", "management", "suite"]
+readme = "./README.md"
+license = "LGPL-2.1"
+
+website = "http://imag-pim.org"
+documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.html"
+repository = "https://github.com/matthiasbeyer/imag"
+
+[dependencies]
+
+[workspace]
+members = [
+ "bin",
+ "imag-bookmark",
+ "imag-counter",
+ "imag-diary",
+ "imag-link",
+ "imag-notes",
+ "imagrc.toml",
+ "imag-ref",
+ "imag-store",
+ "imag-tag",
+ "imag-todo",
+ "imag-view",
+ "libimagbookmark",
+ "libimagcliutil",
+ "libimagcounter",
+ "libimagdiary",
+ "libimagentryfilter",
+ "libimagentrylink",
+ "libimagentrylist",
+ "libimagentrymarkdown",
+ "libimagentrymarkup",
+ "libimagentryselect",
+ "libimagentrytag",
+ "libimagentryview",
+ "libimagerror",
+ "libimaginteraction",
+ "libimagnotes",
+ "libimagnotification",
+ "libimagref",
+ "libimagrt",
+ "libimagstore",
+ "libimagstorestdhook",
+ "libimagtimeui",
+ "libimagtodo",
+ "libimagutil",
+]
+
diff --git a/README.md b/README.md
index ee8e5c8..779839e 100644
--- a/README.md
+++ b/README.md
@@ -2,16 +2,16 @@
`imag` is a commandline personal information management suite.
-**This application is in early development. There are _some_ things that work,
-but we do not consider anything stable or usable at this moment. Feel free to
-play around anyways.**
-
[![Build Status](https://travis-ci.org/matthiasbeyer/imag.svg?branch=master)](https://travis-ci.org/matthiasbeyer/imag)
[![Issue Stats](http://www.issuestats.com/github/matthiasbeyer/imag/badge/pr?style=flat-square)](http://www.issuestats.com/github/matthiasbeyer/imag)
[![Issue Stats](http://www.issuestats.com/github/matthiasbeyer/imag/badge/issue?style=flat-square)](http://www.issuestats.com/github/matthiasbeyer/imag)
[![license](https://img.shields.io/github/license/matthiasbeyer/imag.svg?maxAge=2592000?style=flat-square)]()
-## What is this / Goal and Functionality
+**This application is in early development. There are _some_ things that work,
+but we do not consider anything stable or usable at this moment. Feel free to
+play around anyways.**
+
+## Goal / What is imag?
Our (long-term) goal is to
@@ -20,35 +20,23 @@ Our (long-term) goal is to
> management, consists of reusable parts and integrates well with known
> commandline tools.
-We try to implement as many aspects of personal information management (PIM),
-but re-use existing commandline tools.
-We do this by tracking/referring to the data the tools create.
-A user can now link pieces of data (from different tools), tag this data and
-query/search this data using imag.
-So `imag` is more like a data-mining helper than an actual PIM tool, but we
-implement some of the PIM aspects directly in `imag`.
-Parts of PIM (we call them "modules") that are already implemented and basically
-working:
-
-* todo (via taskwarrior, we track the tasks one creates in taskwarrior)
-* diary
-* notes
-* bookmarks
-* counter (just an example, nothing that usable)
-
-Helper modules that come with `imag` but are not "PIM aspects":
-
-* linking entries
-* viewing entries
-* tagging entries
-* creating misc entries
-* creating entries that refer to files/directories
+imag is a PIM _helper_. We do not actually implement the PIM functionality, but
+try to interface with existing PIM tools (via their API or via some standard
+format they use, e.g. vcard) to make the data they manage _linkable_
+and _queryable_ in an uniform way.
+
+imag consists of _modules_ (e.g. `imag-notes`, `imag-diary`), where each module
+covers one PIM aspect.
+The initial approach is to use one PIM tool for one module.
+So you can use `imag-todo` with [taskwarrior](https://taskwarrior.org/)
+but `imag-calendar` with [icalendar](https://en.wikipedia.org/wiki/ICalendar)
+files.
## Building/Running
-Here goes how to try `imag` out.
+Here is how to try `imag` out.
-`imag` is a _suite_ of tools and you can build them individually.
+`imag` is a _suite/collection_ of tools and you can build them individually.
All subdirectories prefixed with "`libimag"` are libraries for the respective
binaries.
All subdirectories prefixed with `"imag-"` are binaries and compiling them will
@@ -56,79 +44,69 @@ give you a commandline application.
### Building
-By now, there are several targets in the Makefile, fulfilling following roles:
-
-* `all` is the default and builds every crate in debug mode.
- To build a single module, call `make <module>`, for example `make imag-store`.
-* `release`, as the name implies, builds every module in release mode.
- E.G.: `make imag-store-release` to build "imag-store" in release mode.
-* `install` will install all commandline modules to the default installation
- root (see `man cargo-install`).
- To install a single module, run `make <module>-install`,
- E.G.: `make imag-store-install`
-* `bin`/`lib` are separate targets for either building all binaries or
- libraries.
-* `lib-test` runs `cargo test` for all libraries.
- For testing a single library, E.G.: `make test-libimagstore`.
-* `clean` will run `cargo clean` in every crate.
- For cleaning a single crate, use `make imag-store-clean` for example.
-* to build _only_ the `imag` binary, use the target `imag-bin`
- (`imag-bin-release` for release build, `imag-bin-clean` for `cargo clean`ing).
+We use `make` to automate the build process (as `cargo` is not (yet?) able to
+build several applications at once).
+Make sure to _not_ include some `-j 8` arguments, as cargo parallelizes the
+build process on its own. If you parallelize it with make, you end up with a
+really high load on your system.
+
+There are several targets for each of the sub-crates in the Makefile:
+
+| Target | Multi | Purpose | Example |
+| :--- | ----- | :--- | :--- |
+| all | | Build everything, debug mode | `make all` |
+| bin | | Build all binaries, debug mode | `make bin` |
+| lib | | Build all libraries, debug mode | `make lib` |
+| lib-test | | Test all libraries | `make lib-test` |
+| imag-bin | | Build only the `imag` binary, debug mode | `make imag-bin` |
+| check | * | Run `cargo check` | `make check` |
+| clean | * | Remove build artifacts | `make clean` |
+| install | * | Build everything, release mode, install | `make install` |
+| release | * | Build everything, release mode | `make release` |
+| update | * | Run `cargo update` | `make update` |
+
+The `Multi` targets are callable for each sub-crate. For example you can call
+`make imag-bookmark-check` to run `cargo check` on the `imag-bookmark` subcrate.
### Running
-To test out a single module, simply using `cargo run -- <options>` in the
-respective directory will do the trick.
-But you can also `make <module>` and call the binary on the commandline.
-For using it "normally", install the
-binaries as described above, as well as the imag-binary:
+After you build the module you want to play with, you can simply call the binary
+itself with the `--help` flag, to get some help what the module is capable of.
-```
-$> make install
-```
-
-The installation root of the binaries may not yet be in your $PATH.
-To see where this installation root is check out `man cargo-install`.
-To change the $PATH in bash:
-
-```bash
-$> PATH=$PATH:~/.cargo/bin
-$> imag --help
-```
-
-To test, simply add `--help` to one of the above commands:
-
-```bash
-$> imag counter --help
-```
+If you installed the module, you can either call `imag-<modulename>` (if the
+install-directory is in your `$PATH`), or install the `imag` binary to call `imag
+<modulename>` (also if everything is in your `$PATH`).
## Staying up-to-date
-Despite we have a [official site for imag](http://imag-pim.org), I do not push
-updates to this site, yet. Anyways, I post a blog articles about what happened
-in the last two weeks every other week.
+We have a [official website for imag](http://imag-pim.org), where I post
+[release notes](http://imag-pim.org/releases/).
+There is no RSS feed, though.
+
+We also have a [mailinglist](http://imag-pim.org/mailinglist/) where I post
+updates and where discussion and questions are encouraged.
-You can find them
-[on my personal blog, tagged "imag"](http://beyermatthias.de/tags/imag.html)
+There is a blog series which gets a update every other week
+on my blog, where
+[entries are tagged "imag"](http://beyermatthias.de/tags/imag.html).
+I also post non-regular posts about imag things there.
I also post these blog posts
[on reddit](https://www.reddit.com/r/rust/search?q=What%27s+coming+up+in+imag&restrict_sr=on)
and submit them to [this-week-in-rust](https://this-week-in-rust.org/).
-From time to time I publish an article about imag which does not focus on some
-things that are happening, but rather about something more general.
-
## Documentation
-For detailed information, please read [the documentation](./doc/).
-You can either read the Markdown files or compile it to HTML/PDF using
-[pandoc](http://pandoc.org).
+This is a hobby project, so sometimes things are not optimal and might go
+unrecognized and slip through. Feel free to open issues about things you notice!
+
+Though, we have some documentation in [the ./doc subtree](./doc/)
+which can be compiled to PDF or a website.
+These docs are not published anywhere and are not even integrated into our CI,
+so it might be broken (though it's unlikely).
Developer documentation is also available
[online on github.io](https://matthiasbeyer.github.io/imag/imag_documentation/index.html).
-Please note that the documentation is work in progress as well and may be
-outdated.
-
## Please contribute!
We are looking for contributors!
@@ -154,6 +132,3 @@ or our [mailinglist](http://imag-pim.org/mailinglist/).
We chose to distribute this software under terms of GNU LGPLv2.1.
-This decision was made to ensure everyone can write applications which use the
-imag core functionality which is distributed with the imag source distribution.
-
diff --git a/bin/Cargo.toml b/bin/Cargo.toml
index f49197c..76cc063 100644
--- a/bin/Cargo.toml
+++ b/bin/Cargo.toml
@@ -13,6 +13,18 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "build.rs"
+
+[build-dependencies]
+clap = ">=2.16.1"
+version = "2.0"
+libimagrt = { path = "../libimagrt" }
+libimagentrytag = { path = "../libimagentrytag" }
+libimagutil = { path = "../libimagutil" }
+
+[profile.dev]
+codegen-units = 2
+
[dependencies]
version = "2.0"
walkdir = "0.1"
diff --git a/bin/build.rs b/bin/build.rs
new file mode 100644
index 0000000..a7d44a2
--- /dev/null
+++ b/bin/build.rs
@@ -0,0 +1,90 @@
+extern crate clap;
+extern crate libimagrt;
+extern crate libimagentrytag;
+extern crate libimagutil;
+#[macro_use] extern crate version;
+
+use clap::Shell;
+use libimagrt::runtime::Runtime;
+
+/// This macro generates mods with the given '$modulename',
+/// whose content is the file given with `$path`.
+/// In this case, It is used specifically to include the
+/// `ui.rs` files of the imag binaries.
+/// The imag project (accidentally?) followed the convention
+/// to write a `ui.rs` containing the function
+/// `fn build_ui(app : App) -> App`.
+/// This macro allows us to use the same named functions by
+/// putting them each into their own module.
+macro_rules! gen_mods_buildui {
+ ($(($path:expr, $modulename:ident)$(,)*)*) => (
+ $(
+ mod $modulename {
+ include!($path);
+ }
+ )*
+ )
+}
+
+/// This macro reduces boilerplate code.
+///
+/// For example: `build_subcommand!("counter", imagcounter)`
+/// will result in the following code:
+/// ```ignore
+/// imagcounter::build_ui(Runtime::get_default_cli_builder(
+/// "counter",
+/// &version!()[..],
+/// "counter"))
+/// ```
+/// As for the `&version!()[..]` part, it does not matter
+/// which version the subcommand is getting here, as the
+/// output of this script is a completion script, which
+/// does not contain information about the version at all.
+macro_rules! build_subcommand {
+ ($name:expr, $module:ident) => (
+ $module::build_ui(Runtime::get_default_cli_builder(
+ $name,
+ &version!()[..],
+ $name))
+ )
+}
+
+// Actually generates the module.
+gen_mods_buildui!(
+ ("../imag-bookmark/src/ui.rs", imagbookmark),
+ ("../imag-counter/src/ui.rs", imagcounter),
+ ("../imag-diary/src/ui.rs", imagdiary),
+ ("../imag-link/src/ui.rs", imaglink),
+ ("../imag-notes/src/ui.rs", imagnotes),
+ ("../imag-ref/src/ui.rs", imagref),
+ ("../imag-store/src/ui.rs", imagstore),
+ ("../imag-tag/src/ui.rs", imagtag),
+ ("../imag-todo/src/ui.rs", imagtodo),
+ ("../imag-view/src/ui.rs", imagview)
+);
+
+fn main() {
+ // Make the `imag`-App...
+ let mut app = Runtime::get_default_cli_builder(
+ "imag",
+ &version!()[..],
+ "imag")
+ // and add all the subapps as subcommands.
+ .subcommand(build_subcommand!("bookmark", imagbookmark))
+ .subcommand(build_subcommand!("counter", imagcounter))
+ .subcommand(build_subcommand!("diary", imagdiary))
+ .subcommand(build_subcommand!("link", imaglink))
+ .subcommand(build_subcommand!("notes", imagnotes))
+ .subcommand(build_subcommand!("ref", imagref))
+ .subcommand(build_subcommand!("store", imagstore))
+ .subcommand(build_subcommand!("tag", imagtag))
+ .subcommand(build_subcommand!("todo", imagtodo))
+ .subcommand(build_subcommand!("view", imagview));
+
+ // Actually generates the completion files
+ app.gen_completions("imag", Shell::Bash, env!("OUT_DIR"));
+ app.gen_completions("imag", Shell::Fish, env!("OUT_DIR"));
+ app.gen_completions("imag", Shell::Zsh, env!("OUT_DIR"));
+
+}
+
diff --git a/imag-bookmark/Cargo.toml b/imag-bookmark/Cargo.toml
index 61b5452..c1b4e55 100644
--- a/imag-bookmark/Cargo.toml
+++ b/imag-bookmark/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
clap = ">=2.17"
log = "0.3"
diff --git a/imag-counter/Cargo.toml b/imag-counter/Cargo.toml
index 016eadf..80fdeda 100644
--- a/imag-counter/Cargo.toml
+++ b/imag-counter/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
clap = ">=2.17"
log = "0.3"
diff --git a/imag-diary/Cargo.toml b/imag-diary/Cargo.toml
index 0ec869a..f0a7568 100644
--- a/imag-diary/Cargo.toml
+++ b/imag-diary/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
chrono = "0.2"
version = "2.0"
diff --git a/imag-link/Cargo.toml b/imag-link/Cargo.toml
index c40a7d3..ffe57ed 100644
--- a/imag-link/Cargo.toml
+++ b/imag-link/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
semver = "0.5.1"
clap = ">=2.17"
diff --git a/imag-link/src/main.rs b/imag-link/src/main.rs
index bc39efe..6f68668 100644
--- a/imag-link/src/main.rs
+++ b/imag-link/src/main.rs
@@ -88,80 +88,77 @@ fn handle_internal_linking(rt: &Runtime) {
debug!("Handle internal linking call");
let cmd = rt.cli().subcommand_matches("internal").unwrap();
- if cmd.is_present("list") {
- debug!("List...");
- for entry in cmd.value_of("list").unwrap().split(',') {
- debug!("Listing for '{}'", entry);
- match get_entry_by_name(rt, entry) {
- Ok(Some(e)) => {
- e.get_internal_links()
- .map(|links| {
- let i = links
- .filter_map(|l| {
- l.to_str()
- .map_warn_err(|e| format!("Failed to convert StoreId to string: {:?}", e))
- .ok()
- })
- .enumerate();
-
- for (i, link) in i {
- println!("{: <3}: {}", i, link);
- }
- })
- .map_err_trace()
- .ok();
- },
+ match cmd.value_of("list") {
+ Some(list) => {
+ debug!("List...");
+ for entry in list.split(',') {
+ debug!("Listing for '{}'", entry);
+ match get_entry_by_name(rt, entry) {
+ Ok(Some(e)) => {
+ e.get_internal_links()
+ .map(|links| {
+ let i = links
+ .filter_map(|l| {
+ l.to_str()
+ .map_warn_err(|e| format!("Failed to convert StoreId to string: {:?}", e))
+ .ok()
+ })
+ .enumerate();
+
+ for (i, link) in i {
+ println!("{: <3}: {}", i, link);
+ }
+ })
+ .map_err_trace()
+ .ok();
+ },
+
+ Ok(None) => {
+ warn!("Entry not found: {:?}", entry);
+ break;
+ }
- Ok(None) => {
- warn!("Entry not found: {:?}", entry);
- break;
+ Err(e) => {
+ trace_error(&e);
+ break;
+ },
}
-
- Err(e) => {
- trace_error(&e);
- break;
- },
- }
- }
- debug!("Listing ready!");
- } else {
- let mut from = {
- let from = get_from_entry(&rt);
- if from.is_none() {
- warn_exit("No 'from' entry", 1);
- }
- from.unwrap()
- };
- debug!("Link from = {:?}", from.deref());
-
- let to = {
- let to = get_to_entries(&rt);
- if to.is_none() {
- warn_exit("No 'to' entry", 1);
}
- to.unwrap()
- };
- debug!("Link to = {:?}", to.iter().map(|f| f.deref()).collect::<Vec<&Entry>>());
-
- match cmd.subcommand_name() {
- Some("add") => {
- for mut to_entry in to {
- if let Err(e) = to_entry.add_internal_link(&mut from) {
- trace_error_exit(&e, 1);
+ debug!("Listing ready!");
+ },
+ None => {
+ let mut from = match get_from_entry(&rt) {
+ None => warn_exit("No 'from' entry", 1),
+ Some(s) => s,
+ };
+ debug!("Link from = {:?}", from.deref());
+
+ let to = match get_to_entries(&rt) {
+ None => warn_exit("No 'to' entry", 1),
+ Some(to) => to,
+ };
+ debug!("Link to = {:?}", to.iter().map(|f| f.deref()).collect::<Vec<&Entry>>());
+
+ match cmd.subcommand_name() {
+ Some("add") => {
+ for mut to_entry in to {
+ if let Err(e) = to_entry.add_internal_link(&mut from) {
+ trace_error_exit(&e, 1);
+ }
}
- }
- },
+ },
- Some("remove") => {
- for mut to_entry in to {
- if let Err(e) = to_entry.remove_internal_link(&mut from) {
- trace_error_exit(&e, 1);
+ Some("remove") => {
+ for mut to_entry in to {
+ if let Err(e) = to_entry.remove_internal_link(&mut from) {
+ trace_error_exit(&e, 1);
+ }
}
- }
- },
+ },
- _ => unreachable!(),
- };
+ _ => unreachable!(),
+ };
+ }
}
}
@@ -216,16 +213,14 @@ fn get_entry_by_name<'a>(rt: &'a Runtime, name: &str) -> Result<Option<FileLockE
fn handle_external_linking(rt: &Runtime) {
let scmd = rt.cli().subcommand_matches("external").unwrap();
let entry_name = scmd.value_of("id").unwrap(); // enforced by clap
- let entry = get_entry_by_name(rt, entry_name);
- if entry.is_err() {
- trace_error_exit(&entry.unwrap_err(), 1);
- }
- let entry = entry.unwrap();
- if entry.is_none() {
- warn!("Entry not found: {:?}", entry_name);
- return;
- }
- let mut entry = entry.unwrap();
+ let mut entry = match get_entry_by_name(rt, entry_name) {
+ Err(e) => trace_error_exit(&e, 1),
+ Ok(None) => {
+ warn!("Entry not found: {:?}", entry_name);
+ return;
+ },
+ Ok(Some(entry)) => entry
+ };
if scmd.is_present("add") {
debug!("Adding link to entry!");
diff --git a/imag-notes/Cargo.toml b/imag-notes/Cargo.toml
index 59f4a80..c7ef71a 100644
--- a/imag-notes/Cargo.toml
+++ b/imag-notes/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
semver = "0.2.1"
clap = ">=2.17"
diff --git a/imag-ref/Cargo.toml b/imag-ref/Cargo.toml
index 730d966..eae8673 100644
--- a/imag-ref/Cargo.toml
+++ b/imag-ref/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
semver = "0.5.1"
clap = ">=2.17"
diff --git a/imag-store/Cargo.toml b/imag-store/Cargo.toml
index f173fc7..c23a020 100644
--- a/imag-store/Cargo.toml
+++ b/imag-store/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
clap = "2.*"
log = "0.3"
diff --git a/imag-tag/Cargo.toml b/imag-tag/Cargo.toml
index 7330e2e..88a97b9 100644
--- a/imag-tag/Cargo.toml
+++ b/imag-tag/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
clap = "2.*"
log = "0.3"
diff --git a/imag-todo/Cargo.toml b/imag-todo/Cargo.toml
index 7a3cbbe..bb75c57 100644
--- a/imag-todo/Cargo.toml
+++ b/imag-todo/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
clap = ">=2.17"
glob = "0.2.11"
diff --git a/imag-view/Cargo.toml b/imag-view/Cargo.toml
index ce0591c..a1f5e60 100644
--- a/imag-view/Cargo.toml
+++ b/imag-view/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
clap = "2.*"
log = "0.3"
diff --git a/libimagbookmark/Cargo.toml b/libimagbookmark/Cargo.toml
index 0c50403..d30bcc0 100644
--- a/libimagbookmark/Cargo.toml
+++ b/libimagbookmark/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
log = "0.3"
semver = "0.5"
diff --git a/libimagcounter/Cargo.toml b/libimagcounter/Cargo.toml
index 0551b42..7478540 100644
--- a/libimagcounter/Cargo.toml
+++ b/libimagcounter/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
log = "0.3"
toml = "0.2.*"
diff --git a/libimagdiary/Cargo.toml b/libimagdiary/Cargo.toml
index ec9f02a..db238f0 100644
--- a/libimagdiary/Cargo.toml
+++ b/libimagdiary/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
chrono = "0.2"
log = "0.3"
diff --git a/libimagentryfilter/Cargo.toml b/libimagentryfilter/Cargo.toml
index fd5562e..8fc6f6f 100644
--- a/libimagentryfilter/Cargo.toml
+++ b/libimagentryfilter/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
clap = ">=2.17"
filters = "0.1.*"
diff --git a/libimagentrylink/Cargo.toml b/libimagentrylink/Cargo.toml
index 69fa4f5..9394beb 100644
--- a/libimagentrylink/Cargo.toml
+++ b/libimagentrylink/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
itertools = "0.4"
log = "0.3"
diff --git a/libimagentrylist/Cargo.toml b/libimagentrylist/Cargo.toml
index 794cd81..0f7a73d 100644
--- a/libimagentrylist/Cargo.toml
+++ b/libimagentrylist/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
clap = "2.*"
log = "0.3"
diff --git a/libimagentrymarkdown/Cargo.toml b/libimagentrymarkdown/Cargo.toml
index 6893a11..914dcfe 100644
--- a/libimagentrymarkdown/Cargo.toml
+++ b/libimagentrymarkdown/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
log = "0.3"
hoedown = "5.0.0"
diff --git a/libimagentrytag/Cargo.toml b/libimagentrytag/Cargo.toml
index baee962..f7f4458 100644
--- a/libimagentrytag/Cargo.toml
+++ b/libimagentrytag/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
clap = "2.*"
log = "0.3"
diff --git a/libimagentrytag/src/tagable.rs b/libimagentrytag/src/tagable.rs
index 21e7c5e..bff7793 100644
--- a/libimagentrytag/src/tagable.rs
+++ b/libimagentrytag/src/tagable.rs
@@ -17,12 +17,9 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
-use std::ops::Deref;
-use std::ops::DerefMut;
-
use itertools::Itertools;
-use libimagstore::store::{Entry, EntryHeader, FileLockEntry};
+use libimagstore::store::{Entry, EntryHeader};
use libimagerror::into::IntoError;
use error::TagErrorKind;
@@ -175,31 +172,3 @@ impl Tagable for Entry {
}
-impl<'a> Tagable for FileLockEntry<'a> {
-
- fn get_tags(&self) -> Result<Vec<Tag>> {
- self.deref().get_tags()
- }
-
- fn set_tags(&mut self, ts: &[Tag]) -> Result<()> {
- self.deref_mut().set_tags(ts)
- }
-
- fn add_tag(&mut self, t: Tag) -> Result<()> {
- self.deref_mut().add_tag(t)
- }
-
- fn remove_tag(&mut self, t: Tag) -> Result<()> {
- self.deref_mut().remove_tag(t)
- }
-
- fn has_tag(&self, t: TagSlice) -> Result<bool> {
- self.deref().has_tag(t)
- }
-
- fn has_tags(&self, ts: &[Tag]) -> Result<bool> {
- self.deref().has_tags(ts)
- }
-
-}
-
diff --git a/libimagentryview/Cargo.toml b/libimagentryview/Cargo.toml
index f29d611..8bf7e59 100644
--- a/libimagentryview/Cargo.toml
+++ b/libimagentryview/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
log = "0.3"
toml = "0.2.*"
diff --git a/libimagerror/Cargo.toml b/libimagerror/Cargo.toml
index d1394bd..2930f5c 100644
--- a/libimagerror/Cargo.toml
+++ b/libimagerror/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
log = "0.3"
ansi_term = "0.9"
diff --git a/libimaginteraction/Cargo.toml b/libimaginteraction/Cargo.toml
index cde39f2..e9333af 100644
--- a/libimaginteraction/Cargo.toml
+++ b/libimaginteraction/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
ansi_term = "0.9.*"
clap = ">=2.17"
diff --git a/libimagnotes/Cargo.toml b/libimagnotes/Cargo.toml
index 36d8e13..357d553 100644
--- a/libimagnotes/Cargo.toml
+++ b/libimagnotes/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
semver = "0.5"
log = "0.3"
diff --git a/libimagref/Cargo.toml b/libimagref/Cargo.toml
index e1d749f..df218e4 100644
--- a/libimagref/Cargo.toml
+++ b/libimagref/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
itertools = "0.5"
log = "0.3"
diff --git a/libimagref/src/reference.rs b/libimagref/src/reference.rs
index 7d73225..0b39285 100644
--- a/libimagref/src/reference.rs
+++ b/libimagref/src/reference.rs
@@ -157,14 +157,14 @@ impl<'a> Ref<'a> {
.map_err(|e| REK::PathHashingError.into_error_with_cause(e))
);
- Ok((file, opt_contenthash, opt_permissions, can, path_hash))
+ Ok((opt_contenthash, opt_permissions, can, path_hash))
})
// and then we convert the PathBuf of the canonicalized path to a String to be able
// to save it in the Ref FileLockEntry obj
// and return
// (file, content hash, permissions, canonicalized path as String, path hash)
- .and_then(|(file, opt_conhash, opt_perm, can, path_hash)| {
+ .and_then(|(opt_conhash, opt_perm, can, path_hash)| {
match can.to_str().map(String::from) {
// UTF convert error in PathBuf::to_str(),
None => Err(REK::PathUTF8Error.into_error()),
diff --git a/libimagrt/Cargo.toml b/libimagrt/Cargo.toml
index 8655bcc..68f2420 100644
--- a/libimagrt/Cargo.toml
+++ b/libimagrt/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
clap = ">=2.17"
env_logger = "0.3"
diff --git a/libimagstore/Cargo.toml b/libimagstore/Cargo.toml
index 53c2395..9a55173 100644
--- a/libimagstore/Cargo.toml
+++ b/libimagstore/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
fs2 = "0.3"
glob = "0.2.11"
diff --git a/libimagstore/src/storeid.rs b/libimagstore/src/storeid.rs
index 8a3623c..72e75d3 100644
--- a/libimagstore/src/storeid.rs
+++ b/libimagstore/src/storeid.rs
@@ -33,12 +33,18 @@ use error::MapErrInto;
use store::Result;
/// The Index into the Store
-#[derive(Debug, Clone, PartialEq, Hash, Eq, PartialOrd, Ord)]
+#[derive(Debug, Clone, Hash, Eq, PartialOrd, Ord)]
pub struct StoreId {
base: Option<PathBuf>,
id: PathBuf,
}
+impl PartialEq for StoreId {
+ fn eq(&self, other: &StoreId) -> bool {
+ self.id == other.id
+ }
+}
+
impl StoreId {
pub fn new(base: Option<PathBuf>, id: PathBuf) -> Result<StoreId> {
diff --git a/libimagstorestdhook/Cargo.toml b/libimagstorestdhook/Cargo.toml
index 483fa1c..82c286c 100644
--- a/libimagstorestdhook/Cargo.toml
+++ b/libimagstorestdhook/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
toml = "0.2.*"
log = "0.3"
diff --git a/libimagtimeui/Cargo.toml b/libimagtimeui/Cargo.toml
index 32509fd..fcf5686 100644
--- a/libimagtimeui/Cargo.toml
+++ b/libimagtimeui/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
clap = ">=2.17"
lazy_static = "0.2"
diff --git a/libimagtodo/Cargo.toml b/libimagtodo/Cargo.toml
index 7b2c913..d46edd3 100644
--- a/libimagtodo/Cargo.toml
+++ b/libimagtodo/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
semver = "0.2"
task-hookrs = "0.2.2"
diff --git a/libimagutil/Cargo.toml b/libimagutil/Cargo.toml
index 7b37d19..2f7c392 100644
--- a/libimagutil/Cargo.toml
+++ b/libimagutil/Cargo.toml
@@ -13,6 +13,9 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+[profile.dev]
+codegen-units = 2
+
[dependencies]
url = "1.2"
boolinator = "2.4.0"
diff --git a/libimagutil/src/edit.rs b/libimagutil/src/edit.rs
index 3cf459f..5d1838f 100644
--- a/libimagutil/src/edit.rs
+++ b/libimagutil/src/edit.rs
@@ -27,9 +27,8 @@ use std::io::Error as IOError;
use tempfile::NamedTempFile;
pub fn edit_in_tmpfile_with_command(mut cmd: Command, s: &mut String) -> Result<bool, IOError> {
- let file = try!(NamedTempFile::new());
+ let mut file = &try!(NamedTempFile::new());
let file_path = file.path();
- let mut file = try!(file.reopen());
try!(file.write_all(&s.clone().into_bytes()[..]));
try!(file.sync_data());