We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8c0532b + ce58f2a commit 03b8617Copy full SHA for 03b8617
src/database.rs
@@ -71,10 +71,16 @@ impl Writer {
71
files: FileTree,
72
filter_prefix: &[u8],
73
) -> io::Result<()> {
74
+ let entries = files.to_list(filter_prefix);
75
+
76
+ // Don't add packages with no file entries to the database.
77
+ if entries.is_empty() {
78
+ return Ok(());
79
+ }
80
let writer = self.writer.as_mut().expect("not dropped yet");
81
let mut encoder =
82
frcode::Encoder::new(writer, b"p".to_vec(), serde_json::to_vec(&path).unwrap());
- for entry in files.to_list(filter_prefix) {
83
+ for entry in entries {
84
entry.encode(&mut encoder)?;
85
}
86
Ok(())
0 commit comments