From 4ab1e8afa6e909b284d0b1f7ffeb37ebcf76ba98 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 11 Aug 2024 19:38:18 -0400 Subject: [PATCH] add docs to make clippy extra happy --- crates/derive/keyfork-derive-openpgp/src/lib.rs | 8 +++++++- crates/derive/keyfork-derive-path-data/src/lib.rs | 1 + crates/qrcode/keyfork-qrcode/src/lib.rs | 10 ++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/crates/derive/keyfork-derive-openpgp/src/lib.rs b/crates/derive/keyfork-derive-openpgp/src/lib.rs index fd1b4db..2804d02 100644 --- a/crates/derive/keyfork-derive-openpgp/src/lib.rs +++ b/crates/derive/keyfork-derive-openpgp/src/lib.rs @@ -19,8 +19,14 @@ use sequoia_openpgp::{ Cert, Packet, }; +// TODO: this key type is actually _not_ the extended private key, so it should be renamed +// something like Prv or PrvKey. + +/// The private key type used with OpenPGP. pub type XPrvKey = SigningKey; -pub type XPrv = ExtendedPrivateKey; + +/// The extended private key type used with OpenPGP. +pub type XPrv = ExtendedPrivateKey; /// An error occurred while creating an OpenPGP key. #[derive(Debug, thiserror::Error)] diff --git a/crates/derive/keyfork-derive-path-data/src/lib.rs b/crates/derive/keyfork-derive-path-data/src/lib.rs index 97822ad..2bde030 100644 --- a/crates/derive/keyfork-derive-path-data/src/lib.rs +++ b/crates/derive/keyfork-derive-path-data/src/lib.rs @@ -6,6 +6,7 @@ use once_cell::sync::Lazy; use keyfork_derive_util::{DerivationIndex, DerivationPath}; +/// All common paths for key derivation. pub mod paths { use super::*; diff --git a/crates/qrcode/keyfork-qrcode/src/lib.rs b/crates/qrcode/keyfork-qrcode/src/lib.rs index 3b9b168..a28f014 100644 --- a/crates/qrcode/keyfork-qrcode/src/lib.rs +++ b/crates/qrcode/keyfork-qrcode/src/lib.rs @@ -103,6 +103,11 @@ pub fn qrencode( const VIDEO_FORMAT_READ_ERROR: &str = "Failed to read video device format"; /// Continuously scan the `index`-th camera for a QR code. +/// +/// # Errors +/// +/// The function may return an error if the hardware is unable to scan video or if an image could +/// not be decoded. #[cfg(feature = "decode-backend-rqrr")] pub fn scan_camera(timeout: Duration, index: usize) -> Result, QRCodeScanError> { let device = Device::new(index)?; @@ -133,6 +138,11 @@ pub fn scan_camera(timeout: Duration, index: usize) -> Result, QR } /// Continuously scan the `index`-th camera for a QR code. +/// +/// # Errors +/// +/// The function may return an error if the hardware is unable to scan video or if an image could +/// not be decoded. #[cfg(feature = "decode-backend-zbar")] pub fn scan_camera(timeout: Duration, index: usize) -> Result, QRCodeScanError> { let device = Device::new(index)?;