Skip to content

Commit

Permalink
Merge pull request #97 from icann/rdap_test
Browse files Browse the repository at this point in the history
addressing a bunch of lints
  • Loading branch information
anewton1998 authored Jan 14, 2025
2 parents 275af26 + a96d4fc commit 77cf96c
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion icann-rdap-client/src/gtld/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct GtldParams<'a> {
pub label: String,
}

impl<'a> GtldParams<'a> {
impl GtldParams<'_> {
pub fn from_parent(&mut self, parent_type: TypeId) -> Self {
GtldParams {
parent_type,
Expand Down
1 change: 1 addition & 0 deletions icann-rdap-client/src/http/reqwest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ impl Default for ReqwestClientConfig {
#[buildstructor::buildstructor]
impl ReqwestClientConfig {
#[builder]
#[allow(clippy::too_many_arguments)]
pub fn new(
user_agent_suffix: Option<String>,
https_only: Option<bool>,
Expand Down
2 changes: 1 addition & 1 deletion icann-rdap-client/src/md/domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fn do_variants(variants: &[Variant], params: MdParams) -> String {
.join(", "),
))
});
md.push_str("\n");
md.push('\n');
md
}

Expand Down
2 changes: 1 addition & 1 deletion icann-rdap-client/src/md/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub struct MdParams<'a> {
pub req_data: &'a RequestData<'a>,
}

impl<'a> MdParams<'a> {
impl MdParams<'_> {
pub fn from_parent(&self, parent_type: TypeId) -> Self {
MdParams {
parent_type,
Expand Down
1 change: 0 additions & 1 deletion icann-rdap-common/src/contact/to_vcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ impl Contact {
/// let v = contact.to_vcard();
/// let json = serde_json::to_string(&v);
/// ```
pub fn to_vcard(&self) -> Vec<Value> {
// start the vcard with the version.
let mut vcard: Vec<Value> = vec![json!(["version", {}, "text", "4.0"])];
Expand Down
2 changes: 1 addition & 1 deletion icann-rdap-common/src/response/autnum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Autnum {
/// .build();
/// ```
#[builder(entry = "basic")]

#[allow(clippy::too_many_arguments)]
pub fn new_autnum(
autnum_range: std::ops::Range<u32>,
handle: Option<String>,
Expand Down
2 changes: 2 additions & 0 deletions icann-rdap-common/src/response/domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ impl Domain {
/// .build();
/// ```
#[builder(entry = "basic")]
#[allow(clippy::too_many_arguments)]
pub fn new_ldh<T: Into<String>>(
ldh_name: T,
unicode_name: Option<String>,
Expand Down Expand Up @@ -240,6 +241,7 @@ impl Domain {
/// .build();
/// ```
#[builder(entry = "idn")]
#[allow(clippy::too_many_arguments)]
pub fn new_idn<T: Into<String>>(
ldh_name: Option<String>,
unicode_name: T,
Expand Down
1 change: 1 addition & 0 deletions icann-rdap-common/src/response/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ impl Entity {
/// .build();
/// ```
#[builder(entry = "basic")]
#[allow(clippy::too_many_arguments)]
pub fn new_handle<T: Into<String>>(
handle: T,
remarks: Vec<crate::response::types::Remark>,
Expand Down
1 change: 1 addition & 0 deletions icann-rdap-common/src/response/nameserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ impl Nameserver {
/// .build().unwrap();
/// ```
#[builder(entry = "basic")]
#[allow(clippy::too_many_arguments)]
pub fn new_ldh<T: Into<String>>(
ldh_name: T,
addresses: Vec<String>,
Expand Down
2 changes: 2 additions & 0 deletions icann-rdap-common/src/response/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ impl Network {
/// .build().unwrap();
/// ```
#[builder(entry = "basic")]
#[allow(clippy::too_many_arguments)]
pub fn new_network(
cidr: String,
handle: Option<String>,
Expand Down Expand Up @@ -240,6 +241,7 @@ impl Network {
}

#[builder(entry = "with_options")]
#[allow(clippy::too_many_arguments)]
pub fn new_network_with_options(
cidr: String,
handle: Option<String>,
Expand Down
5 changes: 5 additions & 0 deletions icann-rdap-common/src/response/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ pub struct ObjectCommon {
#[buildstructor::buildstructor]
impl ObjectCommon {
#[builder(entry = "domain")]
#[allow(clippy::too_many_arguments)]
pub fn new_domain(
handle: Option<String>,
remarks: Option<Remarks>,
Expand All @@ -536,6 +537,7 @@ impl ObjectCommon {
}

#[builder(entry = "ip_network")]
#[allow(clippy::too_many_arguments)]
pub fn new_ip_network(
handle: Option<String>,
remarks: Option<Remarks>,
Expand All @@ -560,6 +562,7 @@ impl ObjectCommon {
}

#[builder(entry = "autnum")]
#[allow(clippy::too_many_arguments)]
pub fn new_autnum(
handle: Option<String>,
remarks: Option<Remarks>,
Expand All @@ -584,6 +587,7 @@ impl ObjectCommon {
}

#[builder(entry = "nameserver")]
#[allow(clippy::too_many_arguments)]
pub fn new_nameserver(
handle: Option<String>,
remarks: Option<Remarks>,
Expand All @@ -608,6 +612,7 @@ impl ObjectCommon {
}

#[builder(entry = "entity")]
#[allow(clippy::too_many_arguments)]
pub fn new_entity(
handle: Option<String>,
remarks: Option<Remarks>,
Expand Down
2 changes: 1 addition & 1 deletion icann-rdap-srv/src/storage/pg/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl<'a> PgTx<'a> {
}

#[async_trait]
impl<'a> TxHandle for PgTx<'a> {
impl TxHandle for PgTx<'_> {
async fn add_entity(&mut self, _entity: &Entity) -> Result<(), RdapServerError> {
todo!()
}
Expand Down

0 comments on commit 77cf96c

Please sign in to comment.