Skip to content

Commit 4b6ecb5

Browse files
committed
fix clippy
1 parent 9d166bf commit 4b6ecb5

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

registry_lib/src/lib.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ pub struct RegistryHelper {
2020
}
2121

2222
impl RegistryHelper {
23+
/// Create a new `RegistryHelper`.
24+
///
25+
/// # Arguments
26+
///
27+
/// * `config` - The string with registry configuration information.
2328
pub fn new(config: &str) -> Result<Self, RegistryError> {
2429
let registry: Registry = match serde_json::from_str(config) {
2530
Ok(config) => config,
@@ -42,6 +47,15 @@ impl RegistryHelper {
4247
self.what_if = true;
4348
}
4449

50+
/// Get from registry.
51+
///
52+
/// # Returns
53+
///
54+
/// * `Registry` - The registry struct.
55+
///
56+
/// # Errors
57+
///
58+
/// * `RegistryError` - The error that occurred.
4559
pub fn get(&self) -> Result<Registry, RegistryError> {
4660
let exist: bool;
4761
let (reg_key, _subkey) = match self.open(Security::Read) {
@@ -88,6 +102,15 @@ impl RegistryHelper {
88102
}
89103
}
90104

105+
/// Set in registry.
106+
///
107+
/// # Returns
108+
///
109+
/// * `Registry` - The registry struct.
110+
///
111+
/// # Errors
112+
///
113+
/// * `RegistryError` - The error that occurred.
91114
pub fn set(&self) -> Result<Option<Registry>, RegistryError> {
92115
let mut what_if_metadata: Vec<String> = Vec::new();
93116
let reg_key = match self.open(Security::Write) {
@@ -194,6 +217,15 @@ impl RegistryHelper {
194217
Ok(None)
195218
}
196219

220+
/// Delete from registry.
221+
///
222+
/// # Returns
223+
///
224+
/// Nothing on success.
225+
///
226+
/// # Errors
227+
///
228+
/// * `RegistryError` - The error that occurred.
197229
pub fn remove(&self) -> Result<(), RegistryError> {
198230
let (reg_key, _subkey) = match self.open(Security::AllAccess) {
199231
Ok(reg_key) => reg_key,

0 commit comments

Comments
 (0)