[niepce] npc-engine: added a few bits of documentation



commit 33b137500575658af81e632bd5a1a8634b076814
Author: Hubert Figuière <hub figuiere net>
Date:   Wed Jan 1 09:50:27 2020 -0500

    npc-engine: added a few bits of documentation

 crates/npc-engine/src/library/commands.rs | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/crates/npc-engine/src/library/commands.rs b/crates/npc-engine/src/library/commands.rs
index 24d4db2..9362b32 100644
--- a/crates/npc-engine/src/library/commands.rs
+++ b/crates/npc-engine/src/library/commands.rs
@@ -250,6 +250,8 @@ pub fn cmd_count_folder(lib: &Library, id: LibraryId) -> bool {
     }
 }
 
+/// Add a keyword. Return `LibraryId` of the keyword, already existing
+/// or created.
 pub fn cmd_add_keyword(lib: &Library, keyword: &str) -> LibraryId {
     match lib.make_keyword(keyword) {
         Ok(id) => {
@@ -383,6 +385,8 @@ pub fn cmd_list_all_labels(lib: &Library) -> bool {
     }
 }
 
+/// This command will create a label, with `name` and `colour`.
+/// Returns id of the label. Or 0 on error.
 pub fn cmd_create_label(lib: &Library, name: &str, colour: &str) -> LibraryId {
     match lib.add_label(name, colour) {
         Ok(id) => {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]