From c204b81f548d632a3956f4ec67a6436128bf1494 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 13 Sep 2018 14:39:31 -0700 Subject: switch to new null (not \N) dump format --- rust/src/bin/fatcat-export.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rust') diff --git a/rust/src/bin/fatcat-export.rs b/rust/src/bin/fatcat-export.rs index 8ab3ef4a..fdb69e26 100644 --- a/rust/src/bin/fatcat-export.rs +++ b/rust/src/bin/fatcat-export.rs @@ -122,11 +122,11 @@ fn parse_line(s: &str) -> Result { Ok(IdentRow { ident_id: FatCatId::from_uuid(&Uuid::from_str(&fields[0])?), rev_id: match fields[1].as_ref() { - "\\N" => None, + "" => None, val => Some(Uuid::from_str(&val)?), }, redirect_id: match fields[2].as_ref() { - "\\N" => None, + "" => None, val => Some(FatCatId::from_uuid(&Uuid::from_str(&val)?)), }, }) @@ -134,8 +134,8 @@ fn parse_line(s: &str) -> Result { #[test] fn test_parse_line() { - assert!(parse_line("00000000-0000-0000-3333-000000000001\t00000000-0000-0000-3333-fff000000001\t\\N").is_ok()); - assert!(parse_line("00000-0000-0000-3333-000000000001\t00000000-0000-0000-3333-fff000000001\t\\N").is_err()); + assert!(parse_line("00000000-0000-0000-3333-000000000001\t00000000-0000-0000-3333-fff000000001\t").is_ok()); + assert!(parse_line("00000-0000-0000-3333-000000000001\t00000000-0000-0000-3333-fff000000001\t").is_err()); assert!(parse_line("00000-0000-0000-3333-000000000001\t00000000-0000-0000-3333-fff000000001").is_err()); assert!(parse_line("00000000-0000-0000-3333-000000000002\t00000000-0000-0000-3333-fff000000001\t00000000-0000-0000-3333-000000000001").is_ok()); } -- cgit v1.2.3