aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/api_helpers.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-12-24 15:17:25 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-12-24 15:17:25 -0800
commit24ab203a00354f768fc48e0786b21de4afcd9c4a (patch)
tree7c5305dafc110fb58e0ab323ba8b58c1f61914ba /rust/src/api_helpers.rs
parentd7a4e4649e1da2c02ec8472173c79f7c708ce19b (diff)
downloadfatcat-24ab203a00354f768fc48e0786b21de4afcd9c4a.tar.gz
fatcat-24ab203a00354f768fc48e0786b21de4afcd9c4a.zip
implement release_year (and rustfmt)
Diffstat (limited to 'rust/src/api_helpers.rs')
-rw-r--r--rust/src/api_helpers.rs22
1 files changed, 15 insertions, 7 deletions
diff --git a/rust/src/api_helpers.rs b/rust/src/api_helpers.rs
index 32750836..b837dfc2 100644
--- a/rust/src/api_helpers.rs
+++ b/rust/src/api_helpers.rs
@@ -22,7 +22,6 @@ pub struct EditContext {
}
impl EditContext {
-
/// This function should always be run within a transaction
pub fn check(&self, conn: &DbConn) -> Result<()> {
let count: i64 = changelog::table
@@ -36,7 +35,6 @@ impl EditContext {
}
}
-
#[derive(Clone, Copy, PartialEq)]
pub struct ExpandFlags {
pub files: bool,
@@ -456,11 +454,21 @@ pub fn check_sha256(raw: &str) -> Result<()> {
#[test]
fn test_check_sha256() {
- assert!(check_sha256("cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452").is_ok());
- assert!(check_sha256("gb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452").is_err());
- assert!(check_sha256("UB1C378F464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452").is_err());
- assert!(check_sha256("cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e45").is_err());
- assert!(check_sha256("cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e4522").is_err());
+ assert!(
+ check_sha256("cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452").is_ok()
+ );
+ assert!(
+ check_sha256("gb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452").is_err()
+ );
+ assert!(
+ check_sha256("UB1C378F464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e452").is_err()
+ );
+ assert!(
+ check_sha256("cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e45").is_err()
+ );
+ assert!(
+ check_sha256("cb1c378f464d5935ddaa8de28446d82638396c61f042295d7fb85e3cccc9e4522").is_err()
+ );
}
pub fn check_release_type(raw: &str) -> Result<()> {