Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 0 additions & 11 deletions hydro_lang/src/compile/embedded_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm idk if this was supposed to be removed actually

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I keep getting warnings recently about the expect not being hit when no features are enabled...

pub fn embedded_cluster_self_id<'a>() -> impl QuotedWithContext<'a, TaglessMemberId, ()> + Clone + 'a
{
Expand Down
10 changes: 4 additions & 6 deletions hydro_lang/src/deploy/deploy_graph_containerized_ecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();

Expand Down
27 changes: 9 additions & 18 deletions hydro_lang/src/deploy/deploy_runtime_containerized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
4 changes: 1 addition & 3 deletions hydro_lang/src/location/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!()
};

Expand Down
5 changes: 2 additions & 3 deletions hydro_lang/src/viz/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -938,9 +938,8 @@ impl<W> HydroJson<'_, W> {
parent_name: Option<&str>,
id_remapping: &mut HashMap<String, String>,
) -> 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
Expand Down
Loading