diff --git a/jetstream/src/error.rs b/jetstream/src/error.rs index 8fdfc39..2708069 100644 --- a/jetstream/src/error.rs +++ b/jetstream/src/error.rs @@ -26,11 +26,17 @@ pub enum ConnectionError { #[error("failed to construct url: {0}")] InvalidEndpointUri(#[from] tokio_tungstenite::tungstenite::http::uri::InvalidUri), #[error("failed to connect to Jetstream instance: {0}")] - WebSocketFailure(#[from] tokio_tungstenite::tungstenite::Error), + WebSocketFailure(Box), #[error("the Jetstream config is invalid (this really should not happen here): {0}")] InvalidConfig(#[from] ConfigValidationError), } +impl From for ConnectionError { + fn from(e: tokio_tungstenite::tungstenite::Error) -> Self { + Self::WebSocketFailure(Box::new(e)) + } +} + /// Possible errors that can occur when receiving events from a Jetstream instance over WebSockets. /// /// See [websocket_task](crate::websocket_task). diff --git a/ufos/src/bin/analyze.rs b/ufos/src/bin/analyze.rs index 7984939..7941990 100644 --- a/ufos/src/bin/analyze.rs +++ b/ufos/src/bin/analyze.rs @@ -138,7 +138,7 @@ fn weekly_parents(rollups: &PartitionHandle) -> anyhow::Result<()> { } let total_parents = parent_counts.len(); let mut sorted: Vec<_> = parent_counts.into_iter().collect(); - sorted.sort_by(|a, b| b.1.cmp(&a.1)); + sorted.sort_by_key(|c| std::cmp::Reverse(c.1)); let top: Vec = sorted .iter() .take(5)