diff --git a/coverage/badges/flat.svg b/coverage/badges/flat.svg index 5cb16b0..a60c12e 100644 --- a/coverage/badges/flat.svg +++ b/coverage/badges/flat.svg @@ -1,6 +1,6 @@ - coverage: 55% + xmlns:xlink="http://www.w3.org/1999/xlink" width="96" height="20" role="img" aria-label="coverage: 58%"> + coverage: 58% @@ -16,8 +16,8 @@ coverage - - 55% + + 58% \ No newline at end of file diff --git a/coverage/badges/flat_square.svg b/coverage/badges/flat_square.svg index f39e529..1f08207 100644 --- a/coverage/badges/flat_square.svg +++ b/coverage/badges/flat_square.svg @@ -1,13 +1,13 @@ - coverage: 55% + xmlns:xlink="http://www.w3.org/1999/xlink" width="96" height="20" role="img" aria-label="coverage: 58%"> + coverage: 58% coverage - 55% + 58% \ No newline at end of file diff --git a/coverage/badges/for_the_badge.svg b/coverage/badges/for_the_badge.svg index ffa661a..e89fe28 100644 --- a/coverage/badges/for_the_badge.svg +++ b/coverage/badges/for_the_badge.svg @@ -1,13 +1,13 @@ - COVERAGE: 55% + xmlns:xlink="http://www.w3.org/1999/xlink" width="142.5" height="28" role="img" aria-label="COVERAGE: 58%"> + COVERAGE: 58% COVERAGE - 55% + 58% \ No newline at end of file diff --git a/coverage/badges/plastic.svg b/coverage/badges/plastic.svg index 09faa0f..709cea3 100644 --- a/coverage/badges/plastic.svg +++ b/coverage/badges/plastic.svg @@ -1,6 +1,6 @@ - coverage: 55% + xmlns:xlink="http://www.w3.org/1999/xlink" width="96" height="18" role="img" aria-label="coverage: 58%"> + coverage: 58% @@ -18,8 +18,8 @@ coverage - - 55% + + 58% \ No newline at end of file diff --git a/coverage/badges/social.svg b/coverage/badges/social.svg index 105f83a..7d3094d 100644 --- a/coverage/badges/social.svg +++ b/coverage/badges/social.svg @@ -1,6 +1,6 @@ - Coverage: 55% + xmlns:xlink="http://www.w3.org/1999/xlink" width="99" height="20" role="img" aria-label="Coverage: 58%"> + Coverage: 58% @@ -20,8 +20,8 @@ Coverage - - 55% + + 58% \ No newline at end of file diff --git a/coverage/core/src/config.rs.html b/coverage/core/src/config.rs.html index 759cbb3..d01b92f 100644 --- a/coverage/core/src/config.rs.html +++ b/coverage/core/src/config.rs.html @@ -2107,7 +2107,7 @@ diff --git a/coverage/core/src/db.rs.html b/coverage/core/src/db.rs.html index 5952c5a..7934d8e 100644 --- a/coverage/core/src/db.rs.html +++ b/coverage/core/src/db.rs.html @@ -832,8 +832,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -848,8 +848,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -880,8 +880,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -928,8 +928,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -960,8 +960,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -992,8 +992,8 @@
- 58 + role="cell" aria-label="60"> + 60
@@ -1008,8 +1008,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2256,8 +2256,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2368,8 +2368,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2416,8 +2416,8 @@
- 54 + role="cell" aria-label="56"> + 56
@@ -2432,8 +2432,8 @@
- 25 + role="cell" aria-label="26"> + 26
@@ -2448,8 +2448,8 @@
- 25 + role="cell" aria-label="26"> + 26
@@ -2464,8 +2464,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2480,8 +2480,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2496,8 +2496,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2512,8 +2512,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2544,8 +2544,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2560,8 +2560,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2576,8 +2576,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2592,8 +2592,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2608,8 +2608,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2624,8 +2624,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2640,8 +2640,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2656,8 +2656,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2672,8 +2672,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2688,8 +2688,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2704,8 +2704,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2736,8 +2736,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -2816,8 +2816,8 @@
- 28 + role="cell" aria-label="29"> + 29
@@ -2832,8 +2832,8 @@
- 28 + role="cell" aria-label="29"> + 29
@@ -2864,8 +2864,8 @@
- 28 + role="cell" aria-label="29"> + 29
@@ -2896,8 +2896,8 @@
- 28 + role="cell" aria-label="29"> + 29
@@ -2912,8 +2912,8 @@
- 28 + role="cell" aria-label="29"> + 29
@@ -3216,8 +3216,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -3232,8 +3232,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -3248,8 +3248,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3296,8 +3296,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3312,8 +3312,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3344,8 +3344,8 @@
- 64 + role="cell" aria-label="68"> + 68
@@ -3376,8 +3376,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3392,8 +3392,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3408,8 +3408,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3424,8 +3424,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3440,8 +3440,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3456,8 +3456,8 @@
- 32 + role="cell" aria-label="34"> + 34
@@ -3472,8 +3472,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3520,8 +3520,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3536,8 +3536,8 @@
- 32 + role="cell" aria-label="34"> + 34
@@ -3552,8 +3552,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3568,8 +3568,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3760,8 +3760,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3776,8 +3776,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3792,8 +3792,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3824,8 +3824,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3840,8 +3840,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3856,8 +3856,8 @@
- 16 + role="cell" aria-label="17"> + 17
@@ -3872,8 +3872,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -3888,8 +3888,8 @@
- 29 + role="cell" aria-label="30"> + 30
@@ -9243,7 +9243,7 @@
diff --git a/coverage/core/src/db/index.html b/coverage/core/src/db/index.html index 627401c..53b6bcc 100644 --- a/coverage/core/src/db/index.html +++ b/coverage/core/src/db/index.html @@ -15,7 +15,7 @@

Lines

- 55.81 %

+ 62.21 %

@@ -23,7 +23,7 @@

Functions

- 24.46 %

+ 31.91 %

@@ -32,7 +32,7 @@

Branches

- 29.33 %

+ 32.76 %

@@ -57,24 +57,24 @@ - 43.07% + 73.72% - 43.07% + 73.72% - 59 / 137 + 101 / 137 - 27.5% - 11 / 40 + 40% + 16 / 40 - 26.81% - 37 / 138 + 45.65% + 63 / 138 @@ -110,25 +110,25 @@ - 80.74% + 95.45% - - 80.74% + + 95.45% - - 109 / 135 + + 168 / 176 - 27.27% - 12 / 44 + 60.42% + 29 / 48 - 37.5% - 45 / 120 + 52.17% + 72 / 138 @@ -189,7 +189,7 @@ diff --git a/coverage/core/src/db/policies.rs.html b/coverage/core/src/db/policies.rs.html index 28208f2..3199114 100644 --- a/coverage/core/src/db/policies.rs.html +++ b/coverage/core/src/db/policies.rs.html @@ -15,7 +15,7 @@

Lines

- 43.07 %

+ 73.72 %

@@ -23,7 +23,7 @@

Functions

- 27.5 %

+ 40 %

@@ -32,7 +32,7 @@

Branches

- 26.81 %

+ 45.65 %

@@ -1648,8 +1648,8 @@
- 4 + role="cell" aria-label="3"> + 3
@@ -1664,8 +1664,8 @@
- 4 + role="cell" aria-label="3"> + 3
@@ -1712,8 +1712,8 @@
- 7 + role="cell" aria-label="5"> + 5
@@ -1856,8 +1856,8 @@
- 3 + role="cell" aria-label="2"> + 2
@@ -1872,8 +1872,8 @@
- 3 + role="cell" aria-label="2"> + 2
@@ -1888,8 +1888,8 @@
- 4 + role="cell" aria-label="3"> + 3
@@ -2288,8 +2288,8 @@
- 15 + role="cell" aria-label="14"> + 14
@@ -2304,8 +2304,8 @@
- 15 + role="cell" aria-label="14"> + 14
@@ -2320,8 +2320,8 @@
- 15 + role="cell" aria-label="14"> + 14
@@ -2480,8 +2480,8 @@
- 15 + role="cell" aria-label="14"> + 14
@@ -2512,8 +2512,8 @@
- 15 + role="cell" aria-label="14"> + 14
@@ -2576,8 +2576,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2608,8 +2608,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2624,8 +2624,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2640,8 +2640,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2656,8 +2656,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2672,8 +2672,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2688,8 +2688,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2704,8 +2704,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2736,8 +2736,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2752,8 +2752,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2768,8 +2768,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2784,8 +2784,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2816,8 +2816,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2832,8 +2832,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2848,8 +2848,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2864,8 +2864,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2880,8 +2880,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2896,8 +2896,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -2960,8 +2960,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -3280,8 +3280,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -3296,8 +3296,8 @@
- 14 + role="cell" aria-label="13"> + 13
@@ -3312,8 +3312,8 @@
- 15 + role="cell" aria-label="14"> + 14
@@ -3456,8 +3456,8 @@
- 22 + role="cell" aria-label="25"> + 25
@@ -3520,8 +3520,8 @@
- 22 + role="cell" aria-label="25"> + 25
@@ -3568,8 +3568,8 @@
- 22 + role="cell" aria-label="25"> + 25
@@ -3584,8 +3584,8 @@
- 22 + role="cell" aria-label="26"> + 26
@@ -3599,13 +3599,13 @@ 223
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                    let pk = row.get("pk")?;
+
                    let pk = row.get("pk")?;
224
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                    Ok(DbVal(
+
                    Ok(DbVal(
225
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                        SubscriptionPolicy {
+
                        SubscriptionPolicy {
227
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                            list: row.get("list")?,
+
                            list: row.get("list")?,
228
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                            send_confirmation: row.get("send_confirmation")?,
+
                            send_confirmation: row.get("send_confirmation")?,
229
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                            open: row.get("open")?,
+
                            open: row.get("open")?,
230
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                            manual: row.get("manual")?,
+
                            manual: row.get("manual")?,
231
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                            request: row.get("request")?,
+
                            request: row.get("request")?,
232
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                            custom: row.get("custom")?,
+
                            custom: row.get("custom")?,
236
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                })
+
                })
- 22 + role="cell" aria-label="25"> + 25
@@ -3872,8 +3872,8 @@
- 22 + role="cell" aria-label="25"> + 25
@@ -3909,7 +3909,7 @@
-
        /// Remove an existing list policy.
+
        /// Remove an existing subscription policy.
-
        /// let list_pk = db
+
        /// let list = db
-
        ///     .unwrap()
+
        ///     .unwrap();
-
        ///     .pk;
+
        /// # assert!(db.list_subscription_policy(list.pk()).unwrap().is_none());
-
        /// db.set_list_post_policy(PostPolicy {
+
        /// let pol = db
-
        ///     pk: 0,
+
        ///     .set_list_subscription_policy(SubscriptionPolicy {
-
        ///     list: list_pk,
+
        ///         pk: -1,
-
        ///     announce_only: false,
+
        ///         list: list.pk(),
-
        ///     subscription_only: true,
+
        ///         send_confirmation: false,
-
        ///     approval_needed: false,
+
        ///         open: true,
-
        ///     open: false,
+
        ///         manual: false,
-
        ///     custom: false,
+
        ///         request: false,
-
        /// })
+
        ///         custom: false,
-
        /// .unwrap();
+
        ///     })
-
        /// db.remove_list_post_policy(1, 1).unwrap();
+
        ///     .unwrap();
-
        /// # }
+
        /// # assert_eq!(db.list_subscription_policy(list.pk()).unwrap().as_ref(), Some(&pol));
-
        /// # do_test(config);
+
        /// db.remove_list_subscription_policy(list.pk(), pol.pk())
-
        /// ```
+
        ///     .unwrap();
284
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
        pub fn remove_list_subscription_policy(&self, list_pk: i64, policy_pk: i64) -> Result<()> {
+
        /// # assert!(db.list_subscription_policy(list.pk()).unwrap().is_none());
285
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
            let mut stmt = self.connection.prepare(
+
        /// # }
-
                "DELETE FROM subscription_policy WHERE pk = ? AND list = ? RETURNING *;",
+
        /// # do_test(config);
287
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
            )?;
+
        /// ```
288
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
            stmt.query_row(rusqlite::params![&policy_pk, &list_pk,], |_| Ok(()))
+
        pub fn remove_list_subscription_policy(&self, list_pk: i64, policy_pk: i64) -> Result<()> {
289
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                .map_err(|err| {
+
            let mut stmt = self.connection.prepare(
290
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
                    if matches!(err, rusqlite::Error::QueryReturnedNoRows) {
+
                "DELETE FROM subscription_policy WHERE pk = ? AND list = ? RETURNING *;",
-
                        Error::from(err).chain_err(|| NotFound("list or list policy not found!"))
+
            )?;
292
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="2"> + 2
-
-
                    } else {
+
            stmt.query_row(rusqlite::params![&policy_pk, &list_pk,], |_| Ok(()))
-
                        err.into()
+
                .map_err(|err| {
294
+ class="column is-1 is-narrow p-0 has-text-centered has-text-danger-light has-background-danger" + role="cell" aria-label="0">
-
-
                    }
+
                    if matches!(err, rusqlite::Error::QueryReturnedNoRows) {
-
                })?;
+
                        Error::from(err).chain_err(|| NotFound("list or list policy not found!"))
-

+                
                    } else {
-
            trace!("remove_list_subscription_policy {} {}.", list_pk, policy_pk);
+
                        err.into()
298
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
            Ok(())
+
                    }
-
        }
+
                })?;
301
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
        /// ```should_panic
+
            trace!("remove_list_subscription_policy {} {}.", list_pk, policy_pk);
302
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
        /// # use mailpot::{models::*, Configuration, Connection, SendMail};
+
            Ok(())
303
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
        /// # use tempfile::TempDir;
+
        }
-
        ///
+

             
-
        /// # let tmp_dir = TempDir::new().unwrap();
+
        /// ```should_panic
-
        /// # let db_path = tmp_dir.path().join("mpot.db");
+
        /// # use mailpot::{models::*, Configuration, Connection, SendMail};
-
        /// # let config = Configuration {
+
        /// # use tempfile::TempDir;
-
        /// #     send_mail: SendMail::ShellCommand("/usr/bin/false".to_string()),
+
        ///
-
        /// #     db_path: db_path.clone(),
+
        /// # let tmp_dir = TempDir::new().unwrap();
-
        /// #     data_path: tmp_dir.path().to_path_buf(),
+
        /// # let db_path = tmp_dir.path().join("mpot.db");
-
        /// #     administrators: vec![],
+
        /// # let config = Configuration {
-
        /// # };
+
        /// #     send_mail: SendMail::ShellCommand("/usr/bin/false".to_string()),
-
        ///
+
        /// #     db_path: db_path.clone(),
-
        /// # fn do_test(config: Configuration) {
+
        /// #     data_path: tmp_dir.path().to_path_buf(),
-
        /// let db = Connection::open_or_create_db(config).unwrap().trusted();
+
        /// #     administrators: vec![],
-
        /// db.remove_list_post_policy(1, 1).unwrap();
+
        /// # };
-
        /// # }
+
        ///
-
        /// # do_test(config);
+
        /// # fn do_test(config: Configuration) {
-
        /// ```
+
        /// let db = Connection::open_or_create_db(config).unwrap().trusted();
-
        #[cfg(doc)]
+
        /// db.remove_list_post_policy(1, 1).unwrap();
-
        pub fn remove_list_subscription_policy_panic() {}
+
        /// # }
-

+                
        /// # do_test(config);
-
        /// Set the unique post policy for a list.
+
        /// ```
324
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
        pub fn set_list_subscription_policy(
+
        #[cfg(doc)]
-
            &self,
+
        pub fn remove_list_subscription_policy_panic() {}
-
            policy: SubscriptionPolicy,
+

             
-
        ) -> Result<DbVal<SubscriptionPolicy>> {
+
        /// Set the unique post policy for a list.
328
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
            if !(policy.open || policy.manual || policy.request || policy.custom) {
+
        pub fn set_list_subscription_policy(
329
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
                return Err(
+
            &self,
330
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
                    "Cannot add empty policy. Having no policy is probably what you want to do."
+
            policy: SubscriptionPolicy,
-
                        .into(),
+
        ) -> Result<DbVal<SubscriptionPolicy>> {
332
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                );
+
            if !(policy.open || policy.manual || policy.request || policy.custom) {
333
+ class="column is-1 is-narrow p-0 has-text-centered has-text-danger-light has-background-danger" + role="cell" aria-label="0">
-
-
            }
+
                return Err(
-
            let list_pk = policy.list;
+
                    "Cannot add empty policy. Having no policy is probably what you want to do."
-

+                
                        .into(),
336
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
            let mut stmt = self.connection.prepare(
+
                );
-
                "INSERT OR REPLACE INTO subscription_policy(list, send_confirmation, open, \
+
            }
338
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                 manual, request, custom) VALUES (?, ?, ?, ?, ?, ?) RETURNING *;",
+
            let list_pk = policy.list;
339
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
            )?;
+

             
340
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
            let ret = stmt
+
            let mut stmt = self.connection.prepare(
-
                .query_row(
+
                "INSERT OR REPLACE INTO subscription_policy(list, send_confirmation, open, \
342
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
                    rusqlite::params![
+
                 manual, request, custom) VALUES (?, ?, ?, ?, ?, ?) RETURNING *;",
-
                        &list_pk,
+
            )?;
344
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                        &policy.send_confirmation,
+
            let ret = stmt
345
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
                        &policy.open,
+
                .query_row(
346
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                        &policy.manual,
+
                    rusqlite::params![
347
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                        &policy.request,
+
                        &list_pk,
348
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                        &policy.custom,
+
                        &policy.send_confirmation,
349
+
+ 1 +
+
+
                        &policy.open,
+
+
+
+ 350 +
+
+ 1 +
+
+
                        &policy.manual,
+
+
+
+ 351 +
+
+ 1 +
+
+
                        &policy.request,
+
+
+
+ 352 +
+
+ 1 +
+
+
                        &policy.custom,
+
+
+
+ 353 +
@@ -5623,70 +5687,6 @@ role="cell">
                    ],
-
-
- 350 -
-
- -
-
-
                    |row| {
-
-
-
- 351 -
-
- -
-
-
                        let pk = row.get("pk")?;
-
-
-
- 352 -
-
- -
-
-
                        Ok(DbVal(
-
-
-
- 353 -
-
- -
-
-
                            SubscriptionPolicy {
-
354
+
+ 1 +
+
+
                    |row| {
+
+
+
+ 355 +
+
+ 1 +
+
+
                        let pk = row.get("pk")?;
+
+
+
+ 356 +
+
+ 1 +
+
+
                        Ok(DbVal(
+
+
+
+ 357 +
+
+ 1 +
+
+
                            SubscriptionPolicy {
+
+
+
+ 358 +
@@ -5703,70 +5767,6 @@ role="cell">
                                pk,
-
-
- 355 -
-
- -
-
-
                                list: row.get("list")?,
-
-
-
- 356 -
-
- -
-
-
                                send_confirmation: row.get("send_confirmation")?,
-
-
-
- 357 -
-
- -
-
-
                                open: row.get("open")?,
-
-
-
- 358 -
-
- -
-
-
                                manual: row.get("manual")?,
-
359
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                                request: row.get("request")?,
+
                                list: row.get("list")?,
360
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                                custom: row.get("custom")?,
+
                                send_confirmation: row.get("send_confirmation")?,
361
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                            },
+
                                open: row.get("open")?,
362
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                            pk,
+
                                manual: row.get("manual")?,
363
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                        ))
+
                                request: row.get("request")?,
364
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                    },
+
                                custom: row.get("custom")?,
-
                )
+
                            },
366
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
                .map_err(|err| {
+
                            pk,
367
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
                    if matches!(
+
                        ))
368
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                        err,
+
                    },
-
                        rusqlite::Error::SqliteFailure(
+
                )
370
+ class="column is-1 is-narrow p-0 has-text-centered has-text-danger-light has-background-danger" + role="cell" aria-label="0">
-
-
                            rusqlite::ffi::Error {
+
                .map_err(|err| {
371
+ class="column is-1 is-narrow p-0 has-text-centered has-text-danger-light has-background-danger" + role="cell" aria-label="0">
-
-
                                code: rusqlite::ffi::ErrorCode::ConstraintViolation,
+
                    if matches!(
372
+ class="column is-1 is-narrow p-0 has-text-centered has-text-danger-light has-background-danger" + role="cell" aria-label="0">
-
-
                                extended_code: 787
+
                        err,
-
                            },
+
                        rusqlite::Error::SqliteFailure(
-
                            _
+
                            rusqlite::ffi::Error {
-
                        )
+
                                code: rusqlite::ffi::ErrorCode::ConstraintViolation,
-
                    ) {
+
                                extended_code: 787
377
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
                        Error::from(err)
+
                            },
378
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
                            .chain_err(|| NotFound("Could not find a list with this pk."))
+
                            _
-
                    } else {
+
                        )
380
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
                        err.into()
+
                    ) {
381
+ class="column is-1 is-narrow p-0 has-text-centered has-text-danger-light has-background-danger" + role="cell" aria-label="0">
-
-
                    }
+
                        Error::from(err)
-
                })?;
+
                            .chain_err(|| NotFound("Could not find a list with this pk."))
-

+                
                    } else {
-
            trace!("set_list_subscription_policy {:?}.", &ret);
+
                        err.into()
385
+ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" + role="cell" aria-label="no coverage">
-
-
            Ok(ret)
+
                    }
-
        }
+
                })?;
-
    }
+

             
388
+
+ 1 +
+
+
            trace!("set_list_subscription_policy {:?}.", &ret);
+
+
+
+ 389 +
+
+ 1 +
+
+
            Ok(ret)
+
+
+
+ 390 +
+
+ 1 +
+
+
        }
+
+
+
+ 391 +
+
+ +
+
+
    }
+
+
+
+ 392 +
@@ -6251,7 +6315,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/db/posts.rs.html b/coverage/core/src/db/posts.rs.html index a3d5428..10a6a9f 100644 --- a/coverage/core/src/db/posts.rs.html +++ b/coverage/core/src/db/posts.rs.html @@ -12331,7 +12331,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/db/queue.rs.html b/coverage/core/src/db/queue.rs.html index 9a72e3b..bd459c2 100644 --- a/coverage/core/src/db/queue.rs.html +++ b/coverage/core/src/db/queue.rs.html @@ -14,8 +14,8 @@

Lines

-

- 80.74 %

+

+ 95.45 %

@@ -23,7 +23,7 @@

Functions

- 27.27 %

+ 60.42 %

@@ -32,7 +32,7 @@

Branches

- 37.5 %

+ 52.17 %

@@ -464,8 +464,8 @@
- 21 + role="cell" aria-label="31"> + 31
@@ -896,8 +896,8 @@
- 49 + role="cell" aria-label="66"> + 66
@@ -912,8 +912,8 @@
- 49 + role="cell" aria-label="66"> + 66
@@ -943,13 +943,13 @@ 57
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="16"> + 16
-
-
            Self::Hold => "hold",
+
            Self::Hold => "hold",
- 30 + role="cell" aria-label="31"> + 31
@@ -1040,8 +1040,8 @@
- 49 + role="cell" aria-label="66"> + 66
@@ -1103,13 +1103,13 @@ 67
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="20"> + 20
-
-
#[derive(Clone, Deserialize, Serialize, PartialEq, Eq)]
+
#[derive(Clone, Deserialize, Serialize, PartialEq, Eq)]
70
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="10"> + 10
-
-
    pub pk: i64,
+
    pub pk: i64,
72
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="10"> + 10
-
-
    pub queue: Queue,
+
    pub queue: Queue,
74
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="10"> + 10
-
-
    pub list: Option<i64>,
+
    pub list: Option<i64>,
76
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="10"> + 10
-
-
    pub comment: Option<String>,
+
    pub comment: Option<String>,
78
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="10"> + 10
-
-
    pub to_addresses: String,
+
    pub to_addresses: String,
80
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="10"> + 10
-
-
    pub from_address: String,
+
    pub from_address: String,
82
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="10"> + 10
-
-
    pub subject: String,
+
    pub subject: String,
84
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="10"> + 10
-
-
    pub message_id: String,
+
    pub message_id: String,
86
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="10"> + 10
-
-
    pub message: Vec<u8>,
+
    pub message: Vec<u8>,
88
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="10"> + 10
-
-
    pub timestamp: u64,
+
    pub timestamp: u64,
90
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="10"> + 10
-
-
    pub datetime: String,
+
    pub datetime: String,
- 20 + role="cell" aria-label="25"> + 25
@@ -2112,8 +2112,8 @@
- 40 + role="cell" aria-label="50"> + 50
@@ -2144,8 +2144,8 @@
- 33 + role="cell" aria-label="43"> + 43
@@ -2160,8 +2160,8 @@
- 20 + role="cell" aria-label="25"> + 25
@@ -2176,8 +2176,8 @@
- 20 + role="cell" aria-label="25"> + 25
@@ -2240,8 +2240,8 @@
- 20 + role="cell" aria-label="25"> + 25
@@ -2256,8 +2256,8 @@
- 20 + role="cell" aria-label="25"> + 25
@@ -2272,8 +2272,8 @@
- 20 + role="cell" aria-label="25"> + 25
@@ -2288,8 +2288,8 @@
- 20 + role="cell" aria-label="25"> + 25
@@ -2304,8 +2304,8 @@
- 20 + role="cell" aria-label="25"> + 25
@@ -2320,8 +2320,8 @@
- 20 + role="cell" aria-label="25"> + 25
@@ -2336,8 +2336,8 @@
- 20 + role="cell" aria-label="25"> + 25
@@ -2352,8 +2352,8 @@
- 20 + role="cell" aria-label="25"> + 25
@@ -2384,8 +2384,8 @@
- 20 + role="cell" aria-label="25"> + 25
@@ -2464,8 +2464,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2480,8 +2480,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2496,8 +2496,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2576,8 +2576,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2592,8 +2592,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2608,8 +2608,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2624,8 +2624,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2640,8 +2640,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2656,8 +2656,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2672,8 +2672,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2688,8 +2688,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2704,8 +2704,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2720,8 +2720,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2736,8 +2736,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2752,8 +2752,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2784,8 +2784,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2800,8 +2800,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2816,8 +2816,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2832,8 +2832,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2864,8 +2864,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2880,8 +2880,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2896,8 +2896,8 @@
- 20 + role="cell" aria-label="30"> + 30
@@ -2944,8 +2944,8 @@
- 23 + role="cell" aria-label="27"> + 27
@@ -2960,8 +2960,8 @@
- 23 + role="cell" aria-label="27"> + 27
@@ -3008,8 +3008,8 @@
- 38 + role="cell" aria-label="60"> + 60
@@ -3024,8 +3024,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3040,8 +3040,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3056,8 +3056,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3088,8 +3088,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3104,8 +3104,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3120,8 +3120,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3136,8 +3136,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3152,8 +3152,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3168,8 +3168,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3184,8 +3184,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3200,8 +3200,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3216,8 +3216,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3232,8 +3232,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3296,8 +3296,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3328,8 +3328,8 @@
- 23 + role="cell" aria-label="27"> + 27
@@ -3344,8 +3344,8 @@
- 38 + role="cell" aria-label="60"> + 60
@@ -3360,8 +3360,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3376,8 +3376,8 @@
- 15 + role="cell" aria-label="33"> + 33
@@ -3408,8 +3408,8 @@
- 23 + role="cell" aria-label="27"> + 27
@@ -3424,8 +3424,8 @@
- 23 + role="cell" aria-label="27"> + 27
@@ -3472,8 +3472,8 @@
- 6 + role="cell" aria-label="9"> + 9
@@ -3488,8 +3488,8 @@
- 6 + role="cell" aria-label="9"> + 9
@@ -3520,8 +3520,8 @@
- 14 + role="cell" aria-label="24"> + 24
@@ -3536,8 +3536,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -3568,8 +3568,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -3584,8 +3584,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -3600,8 +3600,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -3616,8 +3616,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -3632,8 +3632,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -3648,8 +3648,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -3664,8 +3664,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -3680,8 +3680,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -3696,8 +3696,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -3712,8 +3712,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -3744,8 +3744,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -3760,8 +3760,8 @@
- 12 + role="cell" aria-label="18"> + 18
@@ -3776,8 +3776,8 @@
- 6 + role="cell" aria-label="8"> + 8
@@ -3807,13 +3807,13 @@ 236
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
            tx.prepare("DELETE FROM queue WHERE which = ? AND pk IN rarray(?) RETURNING *;")?
+
            tx.prepare("DELETE FROM queue WHERE which = ? AND pk IN rarray(?) RETURNING *;")?
- 12 + role="cell" aria-label="17"> + 17
@@ -3856,8 +3856,8 @@
- 6 + role="cell" aria-label="8"> + 8
@@ -3903,13 +3903,13 @@ 242
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
            let index = std::rc::Rc::new(
+
            let index = std::rc::Rc::new(
243
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
                index
+
                index
248
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
            stmt.query_map(rusqlite::params![queue.as_str(), index], cl)?
+
            stmt.query_map(rusqlite::params![queue.as_str(), index], cl)?
249
- + class="column is-1 is-narrow p-0 has-text-centered has-text-success-light has-background-success" + role="cell" aria-label="1"> + 1
-
-
        };
+
        };
- 6 + role="cell" aria-label="9"> + 9
@@ -4064,8 +4064,8 @@
- 14 + role="cell" aria-label="24"> + 24
@@ -4080,8 +4080,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -4096,8 +4096,8 @@
- 8 + role="cell" aria-label="15"> + 15
@@ -4128,8 +4128,8 @@
- 6 + role="cell" aria-label="9"> + 9
@@ -4144,8 +4144,8 @@
- 12 + role="cell" aria-label="18"> + 18
@@ -4160,8 +4160,8 @@
- 6 + role="cell" aria-label="9"> + 9
@@ -4176,8 +4176,8 @@
- 6 + role="cell" aria-label="9"> + 9
@@ -4194,6 +4194,1126 @@ class="column is-1 is-narrow p-0 has-text-centered has-text-white has-background-white" role="cell" aria-label="no coverage"> +
+
+
}
+
+
+
+ 261 +
+
+ +
+
+

+            
+
+
+ 262 +
+
+ +
+
+
#[cfg(test)]
+
+
+
+ 263 +
+
+ +
+
+
mod tests {
+
+
+
+ 264 +
+
+ +
+
+
    use super::*;
+
+
+
+ 265 +
+
+ +
+
+

+            
+
+
+ 266 +
+
+ +
+
+
    #[test]
+
+
+
+ 267 +
+
+ 2 +
+
+
    fn test_queue_delete_array() {
+
+
+
+ 268 +
+
+ +
+
+
        use tempfile::TempDir;
+
+
+
+ 269 +
+
+ +
+
+

+            
+
+
+ 270 +
+
+ 1 +
+
+
        let tmp_dir = TempDir::new().unwrap();
+
+
+
+ 271 +
+
+ 1 +
+
+
        let db_path = tmp_dir.path().join("mpot.db");
+
+
+
+ 272 +
+
+ 1 +
+
+
        let config = Configuration {
+
+
+
+ 273 +
+
+ 1 +
+
+
            send_mail: SendMail::ShellCommand("/usr/bin/false".to_string()),
+
+
+
+ 274 +
+
+ 1 +
+
+
            db_path,
+
+
+
+ 275 +
+
+ 1 +
+
+
            data_path: tmp_dir.path().to_path_buf(),
+
+
+
+ 276 +
+
+ 1 +
+
+
            administrators: vec![],
+
+
+
+ 277 +
+
+ +
+
+
        };
+
+
+
+ 278 +
+
+ +
+
+

+            
+
+
+ 279 +
+
+ 1 +
+
+
        let mut db = Connection::open_or_create_db(config).unwrap().trusted();
+
+
+
+ 280 +
+
+ 6 +
+
+
        for i in 0..5 {
+
+
+
+ 281 +
+
+ 5 +
+
+
            db.insert_to_queue(
+
+
+
+ 282 +
+
+ 5 +
+
+
                QueueEntry::new(
+
+
+
+ 283 +
+
+ 5 +
+
+
                    Queue::Hold,
+
+
+
+ 284 +
+
+ 5 +
+
+
                    None,
+
+
+
+ 285 +
+
+ 5 +
+
+
                    None,
+
+
+
+ 286 +
+
+ 5 +
+
+
                    format!("Subject: testing\r\nMessage-Id: {i}@localhost\r\n\r\nHello\r\n")
+
+
+
+ 287 +
+
+ +
+
+
                        .as_bytes(),
+
+
+
+ 288 +
+
+ 5 +
+
+
                    None,
+
+
+
+ 289 +
+
+ +
+
+
                )
+
+
+
+ 290 +
+
+ +
+
+
                .unwrap(),
+
+
+
+ 291 +
+
+ +
+
+
            )
+
+
+
+ 292 +
+
+ 5 +
+
+
            .unwrap();
+
+
+
+ 293 +
+
+ +
+
+
        }
+
+
+
+ 294 +
+
+ 1 +
+
+
        let entries = db.queue(Queue::Hold).unwrap();
+
+
+
+ 295 +
+
+ 1 +
+
+
        assert_eq!(entries.len(), 5);
+
+
+
+ 296 +
+
+ 1 +
+
+
        let out_entries = db.delete_from_queue(Queue::Out, vec![]).unwrap();
+
+
+
+ 297 +
+
+ 1 +
+
+
        assert_eq!(db.queue(Queue::Hold).unwrap().len(), 5);
+
+
+
+ 298 +
+
+ 1 +
+
+
        assert!(out_entries.is_empty());
+
+
+
+ 299 +
+
+ 1 +
+
+
        let deleted_entries = db.delete_from_queue(Queue::Hold, vec![]).unwrap();
+
+
+
+ 300 +
+
+ 1 +
+
+
        assert_eq!(deleted_entries.len(), 5);
+
+
+
+ 301 +
+
+ 1 +
+
+
        assert_eq!(
+
+
+
+ 302 +
+
+ 1 +
+
+
            &entries
+
+
+
+ 303 +
+
+ +
+
+
                .iter()
+
+
+
+ 304 +
+
+ +
+
+
                .cloned()
+
+
+
+ 305 +
+
+ +
+
+
                .map(DbVal::into_inner)
+
+
+
+ 306 +
+
+ 5 +
+
+
                .map(|mut e| {
+
+
+
+ 307 +
+
+ 5 +
+
+
                    e.pk = -1;
+
+
+
+ 308 +
+
+ 5 +
+
+
                    e
+
+
+
+ 309 +
+
+ 5 +
+
+
                })
+
+
+
+ 310 +
+
+ +
+
+
                .collect::<Vec<_>>(),
+
+
+
+ 311 +
+
+ 1 +
+
+
            &deleted_entries
+
+
+
+ 312 +
+
+ +
+
+
        );
+
+
+
+ 313 +
+
+ +
+
+

+            
+
+
+ 314 +
+
+ 6 +
+
+
        for e in deleted_entries {
+
+
+
+ 315 +
+
+ 5 +
+
+
            db.insert_to_queue(e).unwrap();
+
+
+
+ 316 +
+
+ +
+
+
        }
+
+
+
+ 317 +
+
+ +
+
+

+            
+
+
+ 318 +
+
+ 1 +
+
+
        let index = db
+
+
+
+ 319 +
+
+ 1 +
+
+
            .queue(Queue::Hold)
+
+
+
+ 320 +
+
+ +
+
+
            .unwrap()
+
+
+
+ 321 +
+
+ +
+
+
            .into_iter()
+
+
+
+ 322 +
+
+ +
+
+
            .skip(2)
+
+
+
+ 323 +
+
+ 2 +
+
+
            .map(|e| e.pk())
+
+
+
+ 324 +
+
+ +
+
+
            .take(2)
+
+
+
+ 325 +
+
+ +
+
+
            .collect::<Vec<i64>>();
+
+
+
+ 326 +
+
+ 1 +
+
+
        let deleted_entries = db.delete_from_queue(Queue::Hold, index).unwrap();
+
+
+
+ 327 +
+
+ 1 +
+
+
        assert_eq!(deleted_entries.len(), 2);
+
+
+
+ 328 +
+
+ 1 +
+
+
        assert_eq!(db.queue(Queue::Hold).unwrap().len(), 3);
+
+
+
+ 329 +
+
+ 2 +
+
+
    }
+
+
+
+ 330 +
+
+
@@ -4203,7 +5323,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/db/subscriptions.rs.html b/coverage/core/src/db/subscriptions.rs.html index 07555c5..6894641 100644 --- a/coverage/core/src/db/subscriptions.rs.html +++ b/coverage/core/src/db/subscriptions.rs.html @@ -8923,7 +8923,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/db/templates.rs.html b/coverage/core/src/db/templates.rs.html index 7e9f9e5..52ac03b 100644 --- a/coverage/core/src/db/templates.rs.html +++ b/coverage/core/src/db/templates.rs.html @@ -2859,7 +2859,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/index.html b/coverage/core/src/index.html index 17afd06..c6441f4 100644 --- a/coverage/core/src/index.html +++ b/coverage/core/src/index.html @@ -23,7 +23,7 @@

Functions

- 26.93 %

+ 27.41 %

@@ -177,8 +177,8 @@ 143 / 232 - 22.97% - 51 / 222 + 24% + 54 / 225 12.34% @@ -270,7 +270,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/lib.rs.html b/coverage/core/src/lib.rs.html index 5feb3c5..3adb593 100644 --- a/coverage/core/src/lib.rs.html +++ b/coverage/core/src/lib.rs.html @@ -48,8 +48,8 @@
- 2 + role="cell" aria-label="3"> + 3
@@ -2939,7 +2939,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/mail.rs.html b/coverage/core/src/mail.rs.html index 4b09024..1109b05 100644 --- a/coverage/core/src/mail.rs.html +++ b/coverage/core/src/mail.rs.html @@ -2763,7 +2763,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/mail/index.html b/coverage/core/src/mail/index.html index 5ad2324..dc47edc 100644 --- a/coverage/core/src/mail/index.html +++ b/coverage/core/src/mail/index.html @@ -81,7 +81,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/mail/message_filters.rs.html b/coverage/core/src/mail/message_filters.rs.html index e579146..beec892 100644 --- a/coverage/core/src/mail/message_filters.rs.html +++ b/coverage/core/src/mail/message_filters.rs.html @@ -4139,7 +4139,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/models.rs.html b/coverage/core/src/models.rs.html index 1493999..7bb5614 100644 --- a/coverage/core/src/models.rs.html +++ b/coverage/core/src/models.rs.html @@ -23,7 +23,7 @@

Functions

- 22.97 %

+ 24 %

@@ -528,8 +528,8 @@
- 141 + role="cell" aria-label="151"> + 151
@@ -560,8 +560,8 @@
- 64 + role="cell" aria-label="69"> + 69
@@ -640,8 +640,8 @@
- 7 + role="cell" aria-label="9"> + 9
@@ -656,8 +656,8 @@
- 7 + role="cell" aria-label="9"> + 9
@@ -672,8 +672,8 @@
- 7 + role="cell" aria-label="9"> + 9
@@ -736,8 +736,8 @@
- 1 + role="cell" aria-label="6"> + 6
@@ -752,8 +752,8 @@
- 1 + role="cell" aria-label="6"> + 6
@@ -768,8 +768,8 @@
- 1 + role="cell" aria-label="6"> + 6
@@ -848,8 +848,8 @@
- 334 + role="cell" aria-label="333"> + 333
@@ -880,8 +880,8 @@
- 334 + role="cell" aria-label="333"> + 333
@@ -9019,7 +9019,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/models/changesets.rs.html b/coverage/core/src/models/changesets.rs.html index 193bcea..47cf20b 100644 --- a/coverage/core/src/models/changesets.rs.html +++ b/coverage/core/src/models/changesets.rs.html @@ -1963,7 +1963,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/models/index.html b/coverage/core/src/models/index.html index 2fb177f..f912bfe 100644 --- a/coverage/core/src/models/index.html +++ b/coverage/core/src/models/index.html @@ -81,7 +81,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/postfix.rs.html b/coverage/core/src/postfix.rs.html index 6a8cc7d..c461d8e 100644 --- a/coverage/core/src/postfix.rs.html +++ b/coverage/core/src/postfix.rs.html @@ -10779,7 +10779,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/submission.rs.html b/coverage/core/src/submission.rs.html index 6e116f2..1369e39 100644 --- a/coverage/core/src/submission.rs.html +++ b/coverage/core/src/submission.rs.html @@ -608,8 +608,8 @@
- 18 + role="cell" aria-label="17"> + 17
@@ -624,8 +624,8 @@
- 12 + role="cell" aria-label="11"> + 11
@@ -1211,7 +1211,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/core/src/templates.rs.html b/coverage/core/src/templates.rs.html index 867e790..43fa560 100644 --- a/coverage/core/src/templates.rs.html +++ b/coverage/core/src/templates.rs.html @@ -3307,7 +3307,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/coverage.json b/coverage/coverage.json index 3dde9ae..bda2d89 100644 --- a/coverage/coverage.json +++ b/coverage/coverage.json @@ -1 +1 @@ -{"schemaVersion":1,"label":"coverage","message":"55.56%","color":"red"} \ No newline at end of file +{"schemaVersion":1,"label":"coverage","message":"58.09%","color":"red"} \ No newline at end of file diff --git a/coverage/index.html b/coverage/index.html index 77c880d..558f67d 100644 --- a/coverage/index.html +++ b/coverage/index.html @@ -15,7 +15,7 @@

Lines

- 55.56 %

+ 58.09 %

@@ -23,7 +23,7 @@

Functions

- 18.1 %

+ 19.75 %

@@ -32,7 +32,7 @@

Branches

- 29.05 %

+ 30.73 %

@@ -69,8 +69,8 @@ 639 / 999 - 26.93% - 122 / 453 + 27.41% + 125 / 456 30.1% @@ -84,24 +84,24 @@ - 55.81% + 62.21% - 55.81% + 62.21% - 658 / 1179 + 759 / 1220 - 24.46% - 68 / 278 + 31.91% + 90 / 282 - 29.33% - 403 / 1374 + 32.76% + 456 / 1392 @@ -216,7 +216,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/mailpot-tests/src/index.html b/coverage/mailpot-tests/src/index.html index 427e4bf..cf97aaf 100644 --- a/coverage/mailpot-tests/src/index.html +++ b/coverage/mailpot-tests/src/index.html @@ -81,7 +81,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/mailpot-tests/src/lib.rs.html b/coverage/mailpot-tests/src/lib.rs.html index a386a18..b5142b9 100644 --- a/coverage/mailpot-tests/src/lib.rs.html +++ b/coverage/mailpot-tests/src/lib.rs.html @@ -5595,7 +5595,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/web/src/auth.rs.html b/coverage/web/src/auth.rs.html index 3974b57..81a60dd 100644 --- a/coverage/web/src/auth.rs.html +++ b/coverage/web/src/auth.rs.html @@ -11611,7 +11611,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/web/src/cal.rs.html b/coverage/web/src/cal.rs.html index c757e96..abc8c29 100644 --- a/coverage/web/src/cal.rs.html +++ b/coverage/web/src/cal.rs.html @@ -3931,7 +3931,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/web/src/help.rs.html b/coverage/web/src/help.rs.html index 6aabd11..712a479 100644 --- a/coverage/web/src/help.rs.html +++ b/coverage/web/src/help.rs.html @@ -827,7 +827,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/web/src/index.html b/coverage/web/src/index.html index 678ea57..23856ea 100644 --- a/coverage/web/src/index.html +++ b/coverage/web/src/index.html @@ -297,7 +297,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/web/src/lib.rs.html b/coverage/web/src/lib.rs.html index 5bbd404..4ab5b6e 100644 --- a/coverage/web/src/lib.rs.html +++ b/coverage/web/src/lib.rs.html @@ -3627,7 +3627,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/web/src/lists.rs.html b/coverage/web/src/lists.rs.html index 5dd6b72..4719885 100644 --- a/coverage/web/src/lists.rs.html +++ b/coverage/web/src/lists.rs.html @@ -7803,7 +7803,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/web/src/minijinja_utils.rs.html b/coverage/web/src/minijinja_utils.rs.html index ab1e63d..139a612 100644 --- a/coverage/web/src/minijinja_utils.rs.html +++ b/coverage/web/src/minijinja_utils.rs.html @@ -6171,7 +6171,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/web/src/settings.rs.html b/coverage/web/src/settings.rs.html index 2735b14..1271b40 100644 --- a/coverage/web/src/settings.rs.html +++ b/coverage/web/src/settings.rs.html @@ -6667,7 +6667,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/web/src/typed_paths.rs.html b/coverage/web/src/typed_paths.rs.html index 5ea09c9..0b182b6 100644 --- a/coverage/web/src/typed_paths.rs.html +++ b/coverage/web/src/typed_paths.rs.html @@ -9387,7 +9387,7 @@
-

Date: 2023-04-24 23:23

+

Date: 2023-04-25 09:59

diff --git a/coverage/web/src/utils.rs.html b/coverage/web/src/utils.rs.html index d231d20..3784a3e 100644 --- a/coverage/web/src/utils.rs.html +++ b/coverage/web/src/utils.rs.html @@ -3467,7 +3467,7 @@