aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/identifiers.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-05-08 23:41:38 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-05-08 23:41:38 -0700
commitf7c1d9f49854f616e335c8a904e709624a51b0b3 (patch)
treecc7a753dc652d190364e62dd92096417f4c12037 /rust/src/identifiers.rs
parent18eff40d11a4c9deaf65bb5a43e7c3efb33aa1d0 (diff)
downloadfatcat-f7c1d9f49854f616e335c8a904e709624a51b0b3.tar.gz
fatcat-f7c1d9f49854f616e335c8a904e709624a51b0b3.zip
basic impl of new SQL schema in rust code (not wired to API)
Diffstat (limited to 'rust/src/identifiers.rs')
-rw-r--r--rust/src/identifiers.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/rust/src/identifiers.rs b/rust/src/identifiers.rs
index ed88939d..18423643 100644
--- a/rust/src/identifiers.rs
+++ b/rust/src/identifiers.rs
@@ -342,7 +342,7 @@ fn test_check_release_type() {
assert!(check_release_type("book ").is_err());
}
-pub fn check_release_status(raw: &str) -> Result<()> {
+pub fn check_release_stage(raw: &str) -> Result<()> {
let valid_types = vec![
// DRIVER types (minus "version" suffix)
"draft",
@@ -359,19 +359,19 @@ pub fn check_release_status(raw: &str) -> Result<()> {
}
}
Err(FatcatError::NotInControlledVocabulary(
- "release_status".to_string(),
+ "release_stage".to_string(),
raw.to_string(),
))?
}
#[test]
-fn test_check_release_status() {
- assert!(check_release_status("draft").is_ok());
- assert!(check_release_status("retraction").is_ok());
- assert!(check_release_status("published").is_ok());
- assert!(check_release_status("pre-print").is_err());
- assert!(check_release_status("DRAFT").is_err());
- assert!(check_release_status("draft ").is_err());
+fn test_check_release_stage() {
+ assert!(check_release_stage("draft").is_ok());
+ assert!(check_release_stage("retraction").is_ok());
+ assert!(check_release_stage("published").is_ok());
+ assert!(check_release_stage("pre-print").is_err());
+ assert!(check_release_stage("DRAFT").is_err());
+ assert!(check_release_stage("draft ").is_err());
}
pub fn check_contrib_role(raw: &str) -> Result<()> {