aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/bin
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-09-13 14:39:31 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-09-13 14:39:31 -0700
commitc204b81f548d632a3956f4ec67a6436128bf1494 (patch)
tree9eb6930348d4db7b8831a2a02726eed9e456fdca /rust/src/bin
parent5fb593f13219f31993167320f826d08c99c4c7e8 (diff)
downloadfatcat-c204b81f548d632a3956f4ec67a6436128bf1494.tar.gz
fatcat-c204b81f548d632a3956f4ec67a6436128bf1494.zip
switch to new null (not \N) dump format
Diffstat (limited to 'rust/src/bin')
-rw-r--r--rust/src/bin/fatcat-export.rs8
1 files changed, 4 insertions, 4 deletions
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<IdentRow> {
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<IdentRow> {
#[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());
}