diff --git a/Cargo.toml b/Cargo.toml index 7c510d5..b1b25e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ members = [ "icann-rdap-common", "icann-rdap-srv" ] +resolver = "2" [workspace.package] version = "0.0.14" diff --git a/icann-rdap-client/src/md/string.rs b/icann-rdap-client/src/md/string.rs index bd62461..4918a35 100644 --- a/icann-rdap-client/src/md/string.rs +++ b/icann-rdap-client/src/md/string.rs @@ -237,7 +237,7 @@ mod tests { #[test] fn GIVEN_list_of_sentences_WHEN_make_list_all_title_case_THEN_each_sentence_all_title_cased() { // GIVEN - let v = vec!["foo bar", "foO baR"]; + let v = ["foo bar", "foO baR"]; // WHEN let actual = v.make_list_all_title_case(); @@ -249,7 +249,7 @@ mod tests { #[test] fn GIVEN_list_WHEN_make_title_case_list_THEN_comma_separated_title_cased() { // GIVEN - let list = vec!["foo bar", "bizz buzz"]; + let list = ["foo bar", "bizz buzz"]; // WHEN let actual = list.make_title_case_list(); diff --git a/icann-rdap-common/src/contact/from_vcard.rs b/icann-rdap-common/src/contact/from_vcard.rs index c2bc23a..ebba8e2 100644 --- a/icann-rdap-common/src/contact/from_vcard.rs +++ b/icann-rdap-common/src/contact/from_vcard.rs @@ -89,7 +89,7 @@ trait GetText<'a> { impl<'a> GetText<'a> for Option<&'a Vec> { fn get_text(self) -> Option { - let Some(values) = self else { return None }; + let values = self?; let Some(fourth) = values.get(3) else { return None; }; @@ -377,7 +377,7 @@ trait GetNameParts<'a> { impl<'a> GetNameParts<'a> for Option<&'a Vec> { fn get_name_parts(self) -> Option { - let Some(values) = self else { return None }; + let values = self?; let Some(fourth) = values.get(3) else { return None; }; diff --git a/icann-rdap-srv/src/bin/rdap-srv-test-data.rs b/icann-rdap-srv/src/bin/rdap-srv-test-data.rs index c5bb44a..b7ae362 100644 --- a/icann-rdap-srv/src/bin/rdap-srv-test-data.rs +++ b/icann-rdap-srv/src/bin/rdap-srv-test-data.rs @@ -106,7 +106,6 @@ fn make_entity_template( ) -> Result<(), RdapServerError> { let entity = make_test_entity(base_url, None); let ids: Vec = (0..num_entities) - .into_iter() .map(|x| { EntityId::builder() .handle(format!("test-entity-{x}")) @@ -127,7 +126,6 @@ fn make_nameserver_template( ) -> Result<(), RdapServerError> { let nameserver = make_test_nameserver(base_url, None)?; let ids: Vec = (0..num_nameservers) - .into_iter() .map(|x| { NameserverId::builder() .ldh_name(format!("ns.test-nameserver-{x}.example")) @@ -177,7 +175,6 @@ fn make_domain_template( )) .build(); let ids: Vec = (0..num_domains) - .into_iter() .map(|x| { DomainId::builder() .ldh_name(format!("test-domain-{x}.example")) @@ -225,7 +222,6 @@ fn make_autnum_template( )) .build(); let ids: Vec = (0..num_autnums) - .into_iter() .map(|x| AutnumId::builder().start_autnum(x).end_autnum(x).build()) .collect(); let template = Template::Autnum { diff --git a/icann-rdap-srv/src/storage/pg/ops.rs b/icann-rdap-srv/src/storage/pg/ops.rs index 6723b1c..ab2e644 100644 --- a/icann-rdap-srv/src/storage/pg/ops.rs +++ b/icann-rdap-srv/src/storage/pg/ops.rs @@ -1,3 +1,4 @@ +#![allow(clippy::diverging_sub_expression)] use async_trait::async_trait; use icann_rdap_common::response::RdapResponse; use sqlx::{query, PgPool}; diff --git a/icann-rdap-srv/src/storage/pg/tx.rs b/icann-rdap-srv/src/storage/pg/tx.rs index b97f364..6a72e4d 100644 --- a/icann-rdap-srv/src/storage/pg/tx.rs +++ b/icann-rdap-srv/src/storage/pg/tx.rs @@ -1,3 +1,4 @@ +#![allow(clippy::diverging_sub_expression)] use async_trait::async_trait; use icann_rdap_common::response::{ autnum::Autnum, domain::Domain, entity::Entity, nameserver::Nameserver, network::Network, diff --git a/release.md b/release.md new file mode 100644 index 0000000..fb7f0d7 --- /dev/null +++ b/release.md @@ -0,0 +1,23 @@ +Release Process +=============== + +This is the release process which must be carried out by a maintainer +with proper GitHub and crates.io credentials. Without both, this will +fail. + +1. Install the Cargo release plugin (if it is not already installed): `cargo install cargo-release` +1. On the 'dev' branch, use the cargo release plugin to bump either the patch, minor, or major version: `cargo release version patch -x`, `cargo release version minor -x` or `cargo release version major -x`. +1. Run the tests: `cargo test` +1. Commit these changes to git. +1. Push the changes to GitHub. +1. Do a PR from `dev` to `main`. +1. Wait for the test build. +1. Merge the PR. +1. Tag with version from step 2 as 'vVERSION' (lowercase 'v' followed by version number such as 'v0.0.5'). +1. Push the tag to GitHub. This triggers a release build in GitHub Actions. +1. Wait until the release works. It may need some babysitting because the GitHub macOS and Windows builds are sometimes flaky). +1. Switch to main branch: `git switch main` +1. Update local repo branch: `git pull`. +1. Create a build in preparation for of publication to crates.io: `cargo build --release`. +1. Publish to crates.io: `cargo release publish -x` (on occasion this needs babysitting too). +