@@ -4,8 +4,8 @@ use seahorse::{ActionError, ActionResult, Context};
44
55use crate :: config:: get_config_path;
66use crate :: error:: invalid;
7- use crate :: storage:: json:: CfsJSONStore ;
8- use crate :: storage:: { CfsStorage , CfsValue } ;
7+ use crate :: storage:: json:: JSONStore ;
8+ use crate :: storage:: { Store , StoreValue } ;
99
1010pub fn init_action ( _c : & Context ) -> ActionResult {
1111 let config_path = get_config_path ( ) ;
@@ -15,13 +15,13 @@ pub fn init_action(_c: &Context) -> ActionResult {
1515 println ! ( "config file already exists" ) ;
1616 }
1717
18- CfsJSONStore :: with_force_create ( true ) ;
18+ JSONStore :: with_force_create ( true ) ;
1919
2020 Ok ( ( ) )
2121}
2222
2323pub fn list_action ( c : & Context ) -> ActionResult {
24- let store = CfsJSONStore :: with_force_create ( c. bool_flag ( "force-create" ) ) ;
24+ let store = JSONStore :: with_force_create ( c. bool_flag ( "force-create" ) ) ;
2525
2626 for ( key, value) in store. all ( ) . iter ( ) {
2727 println ! ( "{}\t {}" , key, value) ;
@@ -31,7 +31,7 @@ pub fn list_action(c: &Context) -> ActionResult {
3131}
3232
3333pub fn clear_action ( _c : & Context ) -> ActionResult {
34- let mut store = CfsJSONStore :: new ( ) ;
34+ let mut store = JSONStore :: new ( ) ;
3535
3636 store. clear ( ) ;
3737
@@ -51,7 +51,7 @@ pub fn get_action(c: &Context) -> ActionResult {
5151 return Err ( invalid ( "key" ) ) ;
5252 } ;
5353
54- let store = CfsJSONStore :: new ( ) ;
54+ let store = JSONStore :: new ( ) ;
5555
5656 let value = store. get ( key) ;
5757
@@ -86,9 +86,9 @@ pub fn set_action(c: &Context) -> ActionResult {
8686 return Err ( invalid ( "value" ) ) ;
8787 } ;
8888
89- let mut store = CfsJSONStore :: new ( ) ;
89+ let mut store = JSONStore :: new ( ) ;
9090
91- let value = CfsValue :: Value ( value_str. to_owned ( ) ) ;
91+ let value = StoreValue :: Value ( value_str. to_owned ( ) ) ;
9292 store. set ( key, value. clone ( ) ) ;
9393
9494 println ! ( "{}\t {}" , key, value) ;
@@ -101,7 +101,7 @@ pub fn remove_action(c: &Context) -> ActionResult {
101101 return Err ( invalid ( "key" ) ) ;
102102 } ;
103103
104- let mut store = CfsJSONStore :: new ( ) ;
104+ let mut store = JSONStore :: new ( ) ;
105105
106106 match store. remove ( key) {
107107 Some ( value) => println ! ( "{}\t {}" , key, value) ,
0 commit comments