logging: clear clippy warnings

This commit contains two changes:

- clear clippy warnigns
- add pkg/logging/Cargo.lock to .gitignore

Signed-off-by: bin liu <bin@hyper.sh>
This commit is contained in:
bin liu 2020-10-16 15:41:31 +08:00
parent 8c3228c286
commit f32f49bdb7
2 changed files with 2 additions and 3 deletions

1
.gitignore vendored
View File

@ -3,5 +3,6 @@
**/*.rej **/*.rej
**/target **/target
**/.vscode **/.vscode
pkg/logging/Cargo.lock
src/agent/src/version.rs src/agent/src/version.rs
src/agent/kata-agent.service src/agent/kata-agent.service

View File

@ -93,9 +93,7 @@ impl HashSerializer {
// Take care to only add the first instance of a key. This matters for loggers (but not // Take care to only add the first instance of a key. This matters for loggers (but not
// Records) since a child loggers have parents and the loggers are serialised child first // Records) since a child loggers have parents and the loggers are serialised child first
// meaning the *newest* fields are serialised first. // meaning the *newest* fields are serialised first.
if !self.fields.contains_key(&key) { self.fields.entry(key).or_insert(value);
self.fields.insert(key, value);
}
} }
fn remove_field(&mut self, key: &str) { fn remove_field(&mut self, key: &str) {