update doc strings

This commit is contained in:
steven-omaha
2023-02-15 15:57:50 +01:00
parent 9c512073b8
commit e8ae68a374
+10 -6
View File
@@ -9,8 +9,9 @@ use anyhow::{Context, Result};
use super::{Package, Section}; use super::{Package, Section};
/// Representation of a group file, composed of a name (file name from which it was read), the /// Representation of a group file, composed of a name (file name from which it
/// sections in the file, and the absolute path of the original file. /// was read), the sections in the file, and the absolute path of the original
/// file.
#[derive(Debug)] #[derive(Debug)]
pub struct Group { pub struct Group {
pub(crate) name: String, pub(crate) name: String,
@@ -19,13 +20,16 @@ pub struct Group {
} }
impl Group { impl Group {
/// Load all group files from the pacdef group dir. If a group file is not a symlink and /// Load all group files from the pacdef group dir.
/// `warn_not_symlinks` is true, a warning is printed. ///
/// This method will print a warning if
/// - there are no files under `group_dir`, or
/// - `warn_not_symlinks` is true and a group file is not a symlink.
/// ///
/// # Errors /// # Errors
/// ///
/// This function will return an error if any of the files under `group_dir` cannot be /// This function will return an error if any of the files under `group_dir` cannot
/// accessed. /// be accessed.
pub fn load(group_dir: &Path, warn_not_symlinks: bool) -> Result<HashSet<Self>> { pub fn load(group_dir: &Path, warn_not_symlinks: bool) -> Result<HashSet<Self>> {
let mut result = HashSet::new(); let mut result = HashSet::new();