From 495d202e84d76fd15413cda0b3734d35367fdaca Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 7 Dec 2021 09:50:34 -0500 Subject: [PATCH 1/3] Add some missing `#[derive(Debug)]` Hit this when I wanted to add `dbg!`. --- lib/src/container/store.rs | 2 ++ lib/src/container/unencapsulate.rs | 1 + lib/src/lib.rs | 1 + lib/src/tar/write.rs | 1 + 4 files changed, 5 insertions(+) diff --git a/lib/src/container/store.rs b/lib/src/container/store.rs index c973f270..e852b0b3 100644 --- a/lib/src/container/store.rs +++ b/lib/src/container/store.rs @@ -81,6 +81,7 @@ impl LayeredImageState { } /// Context for importing a container image. +#[derive(Debug)] pub struct LayeredImageImporter { repo: ostree::Repo, proxy: ImageProxy, @@ -90,6 +91,7 @@ pub struct LayeredImageImporter { } /// Result of invoking [`LayeredImageImporter::prepare`]. +#[derive(Debug)] pub enum PrepareResult { /// The image reference is already present; the contained string is the OSTree commit. AlreadyPresent(LayeredImageState), diff --git a/lib/src/container/unencapsulate.rs b/lib/src/container/unencapsulate.rs index 6274fd62..4ccf5e57 100644 --- a/lib/src/container/unencapsulate.rs +++ b/lib/src/container/unencapsulate.rs @@ -51,6 +51,7 @@ type Progress = tokio::sync::watch::Sender; /// A read wrapper that updates the download progress. #[pin_project::pin_project] +#[derive(Debug)] struct ProgressReader { #[pin] reader: T, diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 88793b1b..496be316 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -5,6 +5,7 @@ //! written in Rust. #![deny(missing_docs)] +#![deny(missing_debug_implementations)] // Good defaults #![forbid(unused_must_use)] #![deny(unsafe_code)] diff --git a/lib/src/tar/write.rs b/lib/src/tar/write.rs index 578dc710..8af16cb8 100644 --- a/lib/src/tar/write.rs +++ b/lib/src/tar/write.rs @@ -36,6 +36,7 @@ pub struct WriteTarOptions { /// /// This includes some basic data on the number of files that were filtered /// out because they were not in `/usr`. +#[derive(Debug, Default)] pub struct WriteTarResult { /// The resulting OSTree commit SHA-256. pub commit: String, From 685ac081b09496922bfdf085d5520ef4d9c08c1a Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 7 Dec 2021 11:20:47 -0500 Subject: [PATCH 2/3] Drop ununused `bytes` dependency We aren't doing HTTP directly anymore. --- lib/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 302b735c..31470689 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -12,7 +12,6 @@ version = "0.5.1" anyhow = "1.0" containers-image-proxy = "0.3" async-compression = { version = "0.3", features = ["gzip", "tokio"] } -bytes = "1.0.1" bitflags = "1" camino = "1.0.4" cjson = "0.1.1" From 21da3ca59ca9eaf6f354f2b09f700e36f7bbcd0a Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 7 Dec 2021 11:30:41 -0500 Subject: [PATCH 3/3] lib: Also add `unreachable_pub` to opted-in lint And link to the list. I plan to cargo cult this elsewhere. --- lib/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 496be316..0831d57b 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -4,9 +4,10 @@ //! and the Rust bindings to it, adding new functionality //! written in Rust. +// See https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html #![deny(missing_docs)] #![deny(missing_debug_implementations)] -// Good defaults +#![deny(unreachable_pub)] #![forbid(unused_must_use)] #![deny(unsafe_code)] #![cfg_attr(feature = "dox", feature(doc_cfg))]