Reorganize taskchampion crate for docs and tests

The public API of the taskchampion crate now contains the expected parts
and no more, and has some better documentation.

This moves the crate's external `tests/` into internal tests, as the
TaskDB is no longer exposed as part of the crate API.
This commit is contained in:
Dustin J. Mitchell
2020-11-23 15:59:37 -05:00
parent 8f4924f903
commit 8e2b4c3f6c
16 changed files with 395 additions and 347 deletions

View File

@@ -1,6 +1,6 @@
use clap::{App, Arg, SubCommand};
use std::path::Path;
use taskchampion::{taskstorage, Replica, Status, DB};
use taskchampion::{taskstorage, Replica, Status};
use uuid::Uuid;
fn main() {
@@ -20,12 +20,9 @@ fn main() {
.subcommand(SubCommand::with_name("gc").about("run garbage collection"))
.get_matches();
let mut replica = Replica::new(
DB::new(Box::new(
taskstorage::KVStorage::new(Path::new("/tmp/tasks")).unwrap(),
))
.into(),
);
let mut replica = Replica::new(Box::new(
taskstorage::KVStorage::new(Path::new("/tmp/tasks")).unwrap(),
));
match matches.subcommand() {
("add", Some(matches)) => {