Simplify the parser and define password types explicitly.

This commit is contained in:
Kiyomichi Kosaka
2022-12-03 22:57:28 +00:00
parent 47243330a9
commit 66acff9884
5 changed files with 76 additions and 35 deletions
+4 -4
View File
@@ -1,5 +1,4 @@
use crate::password::Password;
use std::{cell::RefCell, rc::Rc};
use crate::password::{Comment, Name, PasswordRef};
#[derive(thiserror::Error, Debug, PartialEq)]
pub enum LKErr<'a> {
@@ -13,9 +12,10 @@ pub enum LKErr<'a> {
#[derive(PartialEq, Debug)]
pub enum Command<'a> {
Add(Rc<RefCell<Password>>),
Add(PasswordRef),
Ls,
Mv(String, String),
Mv(Name, Name),
Comment(Name, Comment),
Error(LKErr<'a>),
Help,
Quit,