aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/bin
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-09-12 11:12:12 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-09-12 11:12:43 -0700
commitaa9abbbab67c6344d382a964b3c451e0bf212efe (patch)
tree75f86c1b9a536a991872c5643dd1cd970a1ca85c /rust/src/bin
parenteb05234037c6cb165e548a43859b77f9d5421189 (diff)
downloadfatcat-aa9abbbab67c6344d382a964b3c451e0bf212efe.tar.gz
fatcat-aa9abbbab67c6344d382a964b3c451e0bf212efe.zip
fix rust in-line tests, and parse_line takes ref
Forgot to run tests before pushing... thanks CI!
Diffstat (limited to 'rust/src/bin')
-rw-r--r--rust/src/bin/fatcat-export.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/src/bin/fatcat-export.rs b/rust/src/bin/fatcat-export.rs
index 1af321ba..8ab3ef4a 100644
--- a/rust/src/bin/fatcat-export.rs
+++ b/rust/src/bin/fatcat-export.rs
@@ -114,7 +114,7 @@ fn loop_printer(output_receiver: channel::Receiver<String>, done_sender: channel
Ok(())
}
-fn parse_line(s: String) -> Result<IdentRow> {
+fn parse_line(s: &str) -> Result<IdentRow> {
let fields: Vec<String> = s.split("\t").map(|v| v.to_string()).collect();
if fields.len() != 3 {
bail!("Invalid input line");
@@ -187,7 +187,7 @@ pub fn do_export(num_workers: usize, expand: Option<ExpandFlags>, entity_type: E
let mut count = 0;
for line in buf_input.lines() {
let line = line?;
- let row = parse_line(line)?;
+ let row = parse_line(&line)?;
match (row.rev_id, row.redirect_id, redirects) {
(None, _, _) => (),
(Some(_), Some(_), false) => (),