@@ -30,7 +30,7 @@ use crate::stitching::ForwardPartialPathStitcher;
30
30
use crate :: CancellationError ;
31
31
use crate :: CancellationFlag ;
32
32
33
- const VERSION : usize = 3 ;
33
+ const VERSION : usize = 4 ;
34
34
35
35
const SCHEMA : & str = r#"
36
36
CREATE TABLE metadata (
@@ -75,9 +75,7 @@ pub enum StorageError {
75
75
#[ error( transparent) ]
76
76
Serde ( #[ from] serde:: Error ) ,
77
77
#[ error( transparent) ]
78
- RmpSerdeDecode ( #[ from] rmp_serde:: decode:: Error ) ,
79
- #[ error( transparent) ]
80
- RmpSerdeEncode ( #[ from] rmp_serde:: encode:: Error ) ,
78
+ PostcardError ( #[ from] postcard:: Error ) ,
81
79
}
82
80
83
81
pub type Result < T > = std:: result:: Result < T , StorageError > ;
@@ -283,7 +281,7 @@ impl SQLiteWriter {
283
281
& file. to_string_lossy ( ) ,
284
282
tag,
285
283
error,
286
- & rmp_serde :: to_vec_named ( & graph) ?,
284
+ & postcard :: to_stdvec ( & graph) ?,
287
285
) ) ?;
288
286
Ok ( ( ) )
289
287
}
@@ -323,7 +321,7 @@ impl SQLiteWriter {
323
321
let mut stmt =
324
322
conn. prepare_cached ( "INSERT INTO graphs (file, tag, value) VALUES (?, ?, ?)" ) ?;
325
323
let graph = serde:: StackGraph :: from_graph_filter ( graph, & FileFilter ( file) ) ;
326
- stmt. execute ( ( file_str, tag, & rmp_serde :: to_vec_named ( & graph) ?) ) ?;
324
+ stmt. execute ( ( file_str, tag, & postcard :: to_stdvec ( & graph) ?) ) ?;
327
325
Ok ( ( ) )
328
326
}
329
327
@@ -364,7 +362,7 @@ impl SQLiteWriter {
364
362
) ;
365
363
let symbol_stack = path. symbol_stack_precondition . storage_key ( graph, partials) ;
366
364
let path = serde:: PartialPath :: from_partial_path ( graph, partials, path) ;
367
- root_stmt. execute ( ( file_str, symbol_stack, & rmp_serde :: to_vec_named ( & path) ?) ) ?;
365
+ root_stmt. execute ( ( file_str, symbol_stack, & postcard :: to_stdvec ( & path) ?) ) ?;
368
366
root_path_count += 1 ;
369
367
} else if start_node. is_in_file ( file) {
370
368
copious_debugging ! (
@@ -375,7 +373,7 @@ impl SQLiteWriter {
375
373
node_stmt. execute ( (
376
374
file_str,
377
375
path. start_node . local_id ,
378
- & rmp_serde :: to_vec_named ( & path) ?,
376
+ & postcard :: to_stdvec ( & path) ?,
379
377
) ) ?;
380
378
node_path_count += 1 ;
381
379
} else {
@@ -525,7 +523,7 @@ impl SQLiteReader {
525
523
copious_debugging ! ( " * Load from database" ) ;
526
524
let mut stmt = conn. prepare_cached ( "SELECT value FROM graphs WHERE file = ?" ) ?;
527
525
let value = stmt. query_row ( [ file] , |row| row. get :: < _ , Vec < u8 > > ( 0 ) ) ?;
528
- let file_graph = rmp_serde :: from_slice :: < serde:: StackGraph > ( & value) ?;
526
+ let file_graph = postcard :: from_bytes :: < serde:: StackGraph > ( & value) ?;
529
527
file_graph. load_into ( graph) ?;
530
528
Ok ( graph. get_file ( file) . expect ( "loaded file to exist" ) )
531
529
}
@@ -581,7 +579,7 @@ impl SQLiteReader {
581
579
& mut self . loaded_graphs ,
582
580
& self . conn ,
583
581
) ?;
584
- let path = rmp_serde :: from_slice :: < serde:: PartialPath > ( & value) ?;
582
+ let path = postcard :: from_bytes :: < serde:: PartialPath > ( & value) ?;
585
583
let path = path. to_partial_path ( & mut self . graph , & mut self . partials ) ?;
586
584
copious_debugging ! (
587
585
" > Loaded {}" ,
@@ -635,7 +633,7 @@ impl SQLiteReader {
635
633
& mut self . loaded_graphs ,
636
634
& self . conn ,
637
635
) ?;
638
- let path = rmp_serde :: from_slice :: < serde:: PartialPath > ( & value) ?;
636
+ let path = postcard :: from_bytes :: < serde:: PartialPath > ( & value) ?;
639
637
let path = path. to_partial_path ( & mut self . graph , & mut self . partials ) ?;
640
638
copious_debugging ! (
641
639
" > Loaded {}" ,
0 commit comments