junobuild_collections/
msg.rs

1use crate::types::core::CollectionKey;
2
3pub const COLLECTION_NOT_EMPTY: &str = "Collection not empty: ";
4
5pub fn msg_db_collection_not_empty(collection: &CollectionKey) -> String {
6    msg_collection_not_empty(collection, &"Datastore".to_string())
7}
8
9pub fn msg_storage_collection_not_empty(collection: &CollectionKey) -> String {
10    msg_collection_not_empty(collection, &"Storage".to_string())
11}
12
13fn msg_collection_not_empty(collection: &CollectionKey, name: &String) -> String {
14    format!(
15        r#"The "{}" collection in {} is not empty."#,
16        collection, name
17    )
18}
19
20pub fn msg_db_collection_not_found(collection: &CollectionKey) -> String {
21    msg_collection_not_found(collection, &"Datastore".to_string())
22}
23
24pub fn msg_storage_collection_not_found(collection: &CollectionKey) -> String {
25    msg_collection_not_found(collection, &"Storage".to_string())
26}
27
28fn msg_collection_not_found(collection: &CollectionKey, name: &String) -> String {
29    format!(r#"Collection "{}" not found in {}."#, collection, name)
30}