Skip to content

Commit

Permalink
Fix clippy warnings (#799)
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Wagner <[email protected]>
  • Loading branch information
nwagner84 authored Jul 15, 2024
1 parent 21f283e commit b0b0c58
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
6 changes: 3 additions & 3 deletions crates/pica-toolkit/src/commands/convert/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ impl ByteRecordWrite for BinaryWriter {
occurrence.write_to(&mut self.writer)?;
}

self.writer.write_all(&[b' '])?;
self.writer.write_all(b" ")?;
for subfield in field.subfields() {
subfield.write_to(&mut self.writer)?;
}

self.writer.write_all(&[b'\x1e'])?;
self.writer.write_all(b"\x1e")?;
}

self.writer.write_all(&[b'\x1d'])?;
self.writer.write_all(b"\x1d")?;
Ok(())
}

Expand Down
8 changes: 4 additions & 4 deletions crates/pica-toolkit/src/commands/convert/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ impl ByteRecordWrite for ImportWriter {
&mut self,
record: &ByteRecord,
) -> std::io::Result<()> {
self.writer.write_all(&[b'\x1d', b'\x0a'])?;
self.writer.write_all(b"'\x1d\x0a")?;

for field in record.iter() {
self.writer.write_all(&[b'\x1e'])?;
self.writer.write_all(b"\x1e")?;

self.writer.write_all(field.tag())?;
if let Some(occurrence) = field.occurrence() {
occurrence.write_to(&mut self.writer)?;
}

self.writer.write_all(&[b' '])?;
self.writer.write_all(b" ")?;
for subfield in field.subfields() {
subfield.write_to(&mut self.writer)?;
}

self.writer.write_all(&[b'\x0a'])?;
self.writer.write_all(b"\x0a")?;
}

Ok(())
Expand Down
4 changes: 2 additions & 2 deletions crates/pica-toolkit/src/commands/convert/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl JsonWriter {
BufWriter::new(Box::new(stdout()))
};

writer.write_all(&[b'['])?;
writer.write_all(b"[")?;
Ok(Self { writer, count: 0 })
}
}
Expand Down Expand Up @@ -71,7 +71,7 @@ impl ByteRecordWrite for JsonWriter {
}

fn finish(&mut self) -> io::Result<()> {
self.writer.write_all(&[b']'])?;
self.writer.write_all(b"]")?;
self.writer.flush()
}
}
4 changes: 2 additions & 2 deletions crates/pica-toolkit/src/commands/convert/plain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl ByteRecordWrite for PlainWriter {
occurrence.write_to(&mut self.writer)?;
}

self.writer.write_all(&[b' '])?;
self.writer.write_all(b" ")?;

for subfield in field.subfields() {
self.writer
Expand All @@ -44,7 +44,7 @@ impl ByteRecordWrite for PlainWriter {
)?;
}

self.writer.write_all(&[b'\n'])?;
self.writer.write_all(b"\n")?;
}

Ok(())
Expand Down
6 changes: 0 additions & 6 deletions crates/pica-toolkit/src/commands/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ pub(crate) struct Hash {
filenames: Vec<OsString>,
}

#[derive(Debug, Deserialize, Serialize)]
struct Row {
idn: Option<String>,
hash: String,
}

impl Hash {
pub(crate) fn run(self, config: &Config) -> CliResult<()> {
let mut progress = Progress::new(self.progress);
Expand Down

0 comments on commit b0b0c58

Please sign in to comment.