diff --git a/src/alert.rs b/src/alert.rs index fd99781..8d3f711 100644 --- a/src/alert.rs +++ b/src/alert.rs @@ -192,7 +192,7 @@ impl Client { "/api/v0/alerts", query_params! { withClosed = *with_closed, - nextId = cursor_opt.map(|cursor| cursor.into()).as_deref().unwrap_or_default(), + nextId = cursor_opt.map(Into::into).as_deref().unwrap_or_default(), limit = limit.to_string(), }, request_body![], diff --git a/src/alert_group_setting.rs b/src/alert_group_setting.rs index 5b3877b..9c7569d 100644 --- a/src/alert_group_setting.rs +++ b/src/alert_group_setting.rs @@ -28,21 +28,21 @@ pub struct AlertGroupSettingValue { #[builder( default, setter(transform = |service_names: impl IntoIterator>| service_names - .into_iter().map(|service_name| service_name.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] #[serde(default, skip_serializing_if = "Vec::is_empty")] pub service_scopes: Vec, #[builder( default, setter(transform = |role_fullnames: impl IntoIterator>| role_fullnames - .into_iter().map(|role_fullname| role_fullname.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] #[serde(default, skip_serializing_if = "Vec::is_empty")] pub role_scopes: Vec, #[builder( default, setter(transform = |monitor_ids: impl IntoIterator>| monitor_ids - .into_iter().map(|monitor_id| monitor_id.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] #[serde(default, skip_serializing_if = "Vec::is_empty")] pub monitor_scopes: Vec, diff --git a/src/downtime.rs b/src/downtime.rs index 7d01b0d..d8c2d85 100644 --- a/src/downtime.rs +++ b/src/downtime.rs @@ -38,42 +38,42 @@ pub struct DowntimeValue { #[builder( default, setter(transform = |service_names: impl IntoIterator>| service_names - .into_iter().map(|service_name| service_name.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] #[serde(default, skip_serializing_if = "Vec::is_empty")] pub service_scopes: Vec, #[builder( default, setter(transform = |service_names: impl IntoIterator>| service_names - .into_iter().map(|service_name| service_name.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] #[serde(default, skip_serializing_if = "Vec::is_empty")] pub service_exclude_scopes: Vec, #[builder( default, setter(transform = |role_fullnames: impl IntoIterator>| role_fullnames - .into_iter().map(|role_fullname| role_fullname.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] #[serde(default, skip_serializing_if = "Vec::is_empty")] pub role_scopes: Vec, #[builder( default, setter(transform = |role_fullnames: impl IntoIterator>| role_fullnames - .into_iter().map(|role_fullname| role_fullname.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] #[serde(default, skip_serializing_if = "Vec::is_empty")] pub role_exclude_scopes: Vec, #[builder( default, setter(transform = |monitor_ids: impl IntoIterator>| monitor_ids - .into_iter().map(|monitor_id| monitor_id.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] #[serde(default, skip_serializing_if = "Vec::is_empty")] pub monitor_scopes: Vec, #[builder( default, setter(transform = |monitor_ids: impl IntoIterator>| monitor_ids - .into_iter().map(|monitor_id| monitor_id.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] #[serde(default, skip_serializing_if = "Vec::is_empty")] pub monitor_exclude_scopes: Vec, diff --git a/src/graph_annotation.rs b/src/graph_annotation.rs index 9726f27..2a701b6 100644 --- a/src/graph_annotation.rs +++ b/src/graph_annotation.rs @@ -32,7 +32,7 @@ pub struct GraphAnnotationValue { #[builder( default, setter(transform = |role_names: impl IntoIterator>| role_names - .into_iter().map(|role_name| role_name.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] #[serde(default, skip_serializing_if = "Vec::is_empty")] pub roles: Vec, diff --git a/src/host.rs b/src/host.rs index 8c4cad2..afdda08 100644 --- a/src/host.rs +++ b/src/host.rs @@ -109,7 +109,7 @@ pub struct HostValue { #[builder( default, setter(transform = |role_fullnames: impl IntoIterator>| role_fullnames - .into_iter().map(|role_fullname| role_fullname.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] #[serde(default, skip_serializing_if = "Vec::is_empty")] pub role_fullnames: Vec, @@ -129,14 +129,14 @@ pub struct HostInterface { #[builder( default, setter(transform = |ipv4_addresses: impl IntoIterator>| ipv4_addresses - .into_iter().map(|ipv4_address| ipv4_address.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] #[serde(default, skip_serializing_if = "Vec::is_empty")] pub ipv4_addresses: Vec, #[builder( default, setter(transform = |ipv6_addresses: impl IntoIterator>| ipv6_addresses - .into_iter().map(|ipv6_address| ipv6_address.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] #[serde(default, skip_serializing_if = "Vec::is_empty")] pub ipv6_addresses: Vec, @@ -395,10 +395,7 @@ impl ListHostsParams { ) -> Self { Self { service_name: Some(service_name.into()), - role_names: role_names - .into_iter() - .map(|role_name| role_name.into()) - .collect::>(), + role_names: role_names.into_iter().map(Into::into).collect::>(), ..Self::default() } } @@ -569,7 +566,7 @@ impl Client { request_body! { ids: Vec = host_ids .into_iter() - .map(|host_id| host_id.into()) + .map(Into::into) .collect::>(), status: HostStatus = host_status, }, @@ -593,7 +590,7 @@ impl Client { request_body! { roleFullnames: Vec = role_fullnames .into_iter() - .map(|role_fullname| role_fullname.into()) + .map(Into::into) .collect::>(), }, response_body!(), @@ -629,7 +626,7 @@ impl Client { request_body! { ids: Vec = host_ids .into_iter() - .map(|host_id| host_id.into()) + .map(Into::into) .collect::>(), }, response_body!(), diff --git a/src/notification_group.rs b/src/notification_group.rs index 4fef818..271bc75 100644 --- a/src/notification_group.rs +++ b/src/notification_group.rs @@ -30,13 +30,13 @@ pub struct NotificationGroupValue { #[builder( default, setter(transform = |notification_group_ids: impl IntoIterator>| notification_group_ids - .into_iter().map(|notification_group_id| notification_group_id.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] pub child_notification_group_ids: Vec, #[builder( default, setter(transform = |channel_ids: impl IntoIterator>| channel_ids - .into_iter().map(|channel_id| channel_id.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] pub child_channel_ids: Vec, #[builder(default)] diff --git a/src/service.rs b/src/service.rs index f19b348..ee8d394 100644 --- a/src/service.rs +++ b/src/service.rs @@ -18,7 +18,7 @@ pub struct Service { #[builder( default, setter(transform = |role_names: impl IntoIterator>| role_names - .into_iter().map(|role_name| role_name.into()).collect::>()), + .into_iter().map(Into::into).collect::>()), )] pub roles: Vec, }