Skip to content

Commit

Permalink
Merge pull request #733 from swimos/rust-1.82
Browse files Browse the repository at this point in the history
Upgrade to Rust 1.82
  • Loading branch information
horned-sphere authored Nov 13, 2024
2 parents 3ac0c70 + 803e2e1 commit 2a82082
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

name: Continuous integration
env:
latest_version: "1.81.0"
latest_version: "1.82.0"

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion example_apps/console/src/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub enum AppCommand {
Quit,
Clear,
Help { command_name: Option<String> },
Controller(ControllerCommand),
Controller(Box<ControllerCommand>),
}

#[derive(Debug)]
Expand Down
4 changes: 2 additions & 2 deletions example_apps/console/src/model/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ pub fn parse_app_command(command: &str) -> Result<AppCommand, Cow<'static, str>>
}),
["quit"] => Ok(AppCommand::Quit),
["clear"] => Ok(AppCommand::Clear),
_ => Ok(AppCommand::Controller(parse_controller_command(
_ => Ok(AppCommand::Controller(Box::new(parse_controller_command(
command_parts.as_slice(),
)?)),
)?))),
}
}

Expand Down
2 changes: 1 addition & 1 deletion example_apps/console/src/model/parse/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fn mixed_tokens3() {

fn to_controller(cmd: AppCommand) -> ControllerCommand {
if let AppCommand::Controller(c) = cmd {
c
*c
} else {
panic!("Unexpected command kind.");
}
Expand Down
2 changes: 1 addition & 1 deletion example_apps/console/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ fn on_command(
Ok(AppCommand::Clear) => None,
Ok(AppCommand::Controller(command)) => Some(
controller
.perform_action(command)
.perform_action(*command)
.into_iter()
.map(|msg| format!("{}\n", msg))
.map(Cow::Owned)
Expand Down
47 changes: 24 additions & 23 deletions server/swimos_connector_fluvio/src/ingress/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ where
let relays = relays.clone();

Ok(unfold(
ConnectorState::Uninit(configuration.clone(), factory.clone()),
ConnectorState::Uninit(Box::new(configuration.clone()), factory.clone()),
move |state: ConnectorState<F::Client, F>| {
let topic = topic.clone();
let key_deser = key_deser.clone();
Expand All @@ -122,28 +122,29 @@ where

let fut = async move {
match state {
ConnectorState::Uninit(config, factory) => match factory.open(config).await
{
Ok(consumer) => {
let (key, value) =
match load_deserializers(key_deser, value_deser).await {
Ok((key, value)) => (key, value),
Err(e) => {
return Some((
Err(FluvioConnectorError::Configuration(e)),
ConnectorState::Failed,
))
}
};
poll_dispatch(
consumer,
topic,
MessageSelector::new(key, value, lanes, relays),
)
.await
ConnectorState::Uninit(config, factory) => {
match factory.open(*config).await {
Ok(consumer) => {
let (key, value) =
match load_deserializers(key_deser, value_deser).await {
Ok((key, value)) => (key, value),
Err(e) => {
return Some((
Err(FluvioConnectorError::Configuration(e)),
ConnectorState::Failed,
))
}
};
poll_dispatch(
consumer,
topic,
MessageSelector::new(key, value, lanes, relays),
)
.await
}
Err(e) => Some((Err(e), ConnectorState::Failed)),
}
Err(e) => Some((Err(e), ConnectorState::Failed)),
},
}
ConnectorState::Running {
topic,
consumer,
Expand Down Expand Up @@ -185,7 +186,7 @@ where
}

enum ConnectorState<C, F> {
Uninit(FluvioIngressConfiguration, F),
Uninit(Box<FluvioIngressConfiguration>, F),
Running {
topic: String,
consumer: C,
Expand Down

0 comments on commit 2a82082

Please sign in to comment.