diff options
author | Michael Gattozzi <mgattozzi@gmail.com> | 2019-12-20 21:25:55 -0500 |
---|---|---|
committer | Michael Gattozzi <mgattozzi@gmail.com> | 2019-12-20 21:25:55 -0500 |
commit | 50badce3dd78dde6baab913ea6af74966af526d3 (patch) | |
tree | 5e9794305566c372e5df15243709c217bf697376 /ticket/src/main.rs | |
parent | 82faafde2c493a4a61fcf71e6c650552699053e7 (diff) |
Upgrade tui to allow commenting from it
This is a fairly large overhaul of ticket but lays down the last bit of
groundwork needed before an initial release. It handles input to write
comments, refactors the code a bit to be cleaner and less computation
heavy, and also adds instructions on the bottom for how to use the tui.
This should be enough for people to start using it, though obviously
there's more work to go, but it feels more usable than before.
Diffstat (limited to 'ticket/src/main.rs')
-rw-r--r-- | ticket/src/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ticket/src/main.rs b/ticket/src/main.rs index 2903db1..88e86cd 100644 --- a/ticket/src/main.rs +++ b/ticket/src/main.rs @@ -135,7 +135,7 @@ fn new() -> Result<()> { version: Version::V1, }; - save_ticket(t) + save_ticket(&t) } fn show(id: Uuid) -> Result<()> { @@ -182,7 +182,7 @@ fn close(id: Uuid) -> Result<()> { if ticket.id == id { let path = ticket_path(&ticket)?; ticket.status = Status::Closed; - save_ticket(ticket)?; + save_ticket(&ticket)?; fs::remove_file(path)?; found = true; break; @@ -217,7 +217,7 @@ fn migrate() -> Result<()> { t.number, ticket_file_name(&ticket) )))?; - save_ticket(ticket)?; + save_ticket(&ticket)?; // We need to make sure we get different times for each ticket // Possible future migrations might not have this issue thread::sleep(time::Duration::from_millis(1000)); @@ -237,7 +237,7 @@ fn comment(id: Uuid, message: String) -> Result<()> { uuid_v1()?, (user_config.uuid, Name(user_config.name), Comment(message)), ); - save_ticket(ticket)?; + save_ticket(&ticket)?; Ok(()) } #[derive(Serialize, Deserialize, Debug)] |