diff --git a/Cargo.toml b/Cargo.toml index 4ae86f9322c7..b0176448200b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,6 +73,8 @@ allow_attributes = "warn" allow_attributes_without_reason = "warn" explicit_into_iter_loop = "warn" let_and_return = "allow" +manual_is_variant_and = "warn" +manual_let_else = "warn" redundant_clone = "warn" self_named_module_files = "warn" str_to_string = "warn" diff --git a/hydro_lang/src/compile/embedded_runtime.rs b/hydro_lang/src/compile/embedded_runtime.rs index 121ce41e58ad..a5150e674ec1 100644 --- a/hydro_lang/src/compile/embedded_runtime.rs +++ b/hydro_lang/src/compile/embedded_runtime.rs @@ -9,17 +9,6 @@ use stageleft::{QuotedWithContext, RuntimeData, q}; use crate::location::MembershipEvent; use crate::location::member_id::TaglessMemberId; -#[cfg_attr( - not(any( - feature = "deploy_integration", - feature = "docker_runtime", - feature = "maelstrom_runtime", - )), - expect( - unreachable_code, - reason = "uninhabited but deploy_integration required at embedded runtime" - ) -)] /// Returns a [`QuotedWithContext`] that references the `__cluster_self_id` runtime variable. pub fn embedded_cluster_self_id<'a>() -> impl QuotedWithContext<'a, TaglessMemberId, ()> + Clone + 'a { diff --git a/hydro_lang/src/deploy/deploy_graph_containerized_ecs.rs b/hydro_lang/src/deploy/deploy_graph_containerized_ecs.rs index 1aa18f41c2db..4b66d8de5858 100644 --- a/hydro_lang/src/deploy/deploy_graph_containerized_ecs.rs +++ b/hydro_lang/src/deploy/deploy_graph_containerized_ecs.rs @@ -333,9 +333,8 @@ impl EcsDeploy { }; for (location_id, name_hint, process) in nodes.get_all_processes() { - let raw_id = match location_id { - LocationId::Process(id) => id, - _ => unreachable!(), + let LocationId::Process(raw_id) = location_id else { + unreachable!() }; let task_family = get_ecs_container_name(&process.name, None); let ports = process.exposed_ports.borrow().clone(); @@ -377,9 +376,8 @@ impl EcsDeploy { } for (location_id, name_hint, cluster) in nodes.get_all_clusters() { - let raw_id = match location_id { - LocationId::Cluster(id) => id, - _ => unreachable!(), + let LocationId::Cluster(raw_id) = location_id else { + unreachable!() }; let task_family_prefix = cluster.name.clone(); diff --git a/hydro_lang/src/deploy/deploy_runtime_containerized.rs b/hydro_lang/src/deploy/deploy_runtime_containerized.rs index 8e63efb4b9b9..cff12783b28e 100644 --- a/hydro_lang/src/deploy/deploy_runtime_containerized.rs +++ b/hydro_lang/src/deploy/deploy_runtime_containerized.rs @@ -131,12 +131,9 @@ impl ChannelMux { let (rx, _tx) = stream.into_split(); let mut source = FramedRead::new(rx, LengthDelimitedCodec::new()); - let magic_frame = match source.next().await { - Some(Ok(frame)) => frame, - _ => { - warn!(name: "magic_failed", ?peer, "no magic frame"); - return; - } + let Some(Ok(magic_frame)) = source.next().await else { + warn!(name: "magic_failed", ?peer, "no magic frame"); + return; }; let magic: ChannelMagic = match bincode::deserialize(&magic_frame) { @@ -152,12 +149,9 @@ impl ChannelMux { return; } - let version_frame = match source.next().await { - Some(Ok(frame)) => frame, - _ => { - warn!(name: "version_failed", ?peer, "no version frame"); - return; - } + let Some(Ok(version_frame)) = source.next().await else { + warn!(name: "version_failed", ?peer, "no version frame"); + return; }; let version: ChannelProtocolVersion = match bincode::deserialize(&version_frame) { @@ -173,12 +167,9 @@ impl ChannelMux { return; } - let handshake_frame = match source.next().await { - Some(Ok(frame)) => frame, - _ => { - warn!(name: "handshake_failed", ?peer, "no handshake frame"); - return; - } + let Some(Ok(handshake_frame)) = source.next().await else { + warn!(name: "handshake_failed", ?peer, "no handshake frame"); + return; }; let handshake: ChannelHandshake = match bincode::deserialize(&handshake_frame) { diff --git a/hydro_lang/src/location/cluster.rs b/hydro_lang/src/location/cluster.rs index f58a1e68106a..b7c3ac656f24 100644 --- a/hydro_lang/src/location/cluster.rs +++ b/hydro_lang/src/location/cluster.rs @@ -166,9 +166,7 @@ where where Self: Sized, { - let cluster_id = if let LocationId::Cluster(id) = ctx.root().id() { - id - } else { + let LocationId::Cluster(cluster_id) = ctx.root().id() else { unreachable!() }; diff --git a/hydro_lang/src/viz/json.rs b/hydro_lang/src/viz/json.rs index 0b7fd732a16c..ea1da5de38f5 100644 --- a/hydro_lang/src/viz/json.rs +++ b/hydro_lang/src/viz/json.rs @@ -938,9 +938,8 @@ impl HydroJson<'_, W> { parent_name: Option<&str>, id_remapping: &mut HashMap, ) -> serde_json::Value { - let mut node_obj = match node { - serde_json::Value::Object(obj) => obj, - _ => return node, + let serde_json::Value::Object(mut node_obj) = node else { + return node; }; let current_name = node_obj