From 12c9a743ff210ca71778143243ec67304116ce07 Mon Sep 17 00:00:00 2001 From: steven-omaha <35634100+steven-omaha@users.noreply.github.com> Date: Fri, 28 Apr 2023 14:28:17 +0200 Subject: [PATCH] docs: add docstrings to two methods --- crates/pacdef_core/src/backend/todo_per_backend.rs | 5 +++++ crates/pacdef_core/src/core.rs | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/crates/pacdef_core/src/backend/todo_per_backend.rs b/crates/pacdef_core/src/backend/todo_per_backend.rs index 13f17e0..2809a28 100644 --- a/crates/pacdef_core/src/backend/todo_per_backend.rs +++ b/crates/pacdef_core/src/backend/todo_per_backend.rs @@ -6,6 +6,11 @@ use anyhow::{bail, ensure, Context, Result}; use super::Backend; use crate::Package; +/// A vector of tuples containing a `dyn Backend` and a vector of unmanaged packages +/// for that backend. +/// +/// This struct is used to store a list of unmanaged packages or missing packages +/// for all backends. #[derive(Debug)] pub struct ToDoPerBackend(Vec<(Box, Vec)>); diff --git a/crates/pacdef_core/src/core.rs b/crates/pacdef_core/src/core.rs index a2d002d..2528e27 100644 --- a/crates/pacdef_core/src/core.rs +++ b/crates/pacdef_core/src/core.rs @@ -178,6 +178,13 @@ impl Pacdef { .context("printing things to do") } + /// Get a list of unmanaged packages per backend. + /// + /// This method loops through all enabled `Backend`s whose binary is in `PATH`. + /// + /// # Errors + /// + /// This function will propagate errors. fn get_unmanaged_packages(&mut self) -> Result { let mut result = ToDoPerBackend::new();