Skip to content

Commit

Permalink
chore: update toolchain to new rust version
Browse files Browse the repository at this point in the history
  • Loading branch information
morenol committed Jul 13, 2023
1 parent 3aba4f3 commit e664f7e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
41 changes: 20 additions & 21 deletions crates/fluvio-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod metadata;
mod render;
pub(crate) mod monitoring;

pub(crate) use error::{CliError};
pub(crate) use error::CliError;
use fluvio_extension_common as common;
pub(crate) const VERSION: &str = include_str!("../../../VERSION");

Expand Down Expand Up @@ -362,6 +362,25 @@ mod root {
fn command_triggers_update_check(cmd: &RootCmd) -> bool {
matches!(cmd, RootCmd::Version(_)) || matches!(cmd, RootCmd::Update(_))
}
mod util {
use fluvio_spu_schema::Isolation;
use crate::{CliError};

pub(crate) fn parse_isolation(s: &str) -> Result<Isolation, String> {
match s {
"read_committed" | "ReadCommitted" | "readCommitted" | "readcommitted" => Ok(Isolation::ReadCommitted),
"read_uncommitted" | "ReadUncommitted" | "readUncommitted" | "readuncommitted" => Ok(Isolation::ReadUncommitted),
_ => Err(format!("unrecognized isolation: {s}. Supported: read_committed (ReadCommitted), read_uncommitted (ReadUncommitted)")),
}
}

pub(crate) fn parse_key_val(s: &str) -> anyhow::Result<(String, String)> {
let pos = s.find('=').ok_or_else(|| {
CliError::InvalidArg(format!("invalid KEY=value: no `=` found in `{s}`"))
})?;
Ok((s[..pos].parse()?, s[pos + 1..].parse()?))
}
}

#[cfg(test)]
mod tests {
Expand Down Expand Up @@ -410,23 +429,3 @@ async fn check_for_channel_update() {
}
}
}

mod util {
use fluvio_spu_schema::Isolation;
use crate::{CliError};

pub(crate) fn parse_isolation(s: &str) -> Result<Isolation, String> {
match s {
"read_committed" | "ReadCommitted" | "readCommitted" | "readcommitted" => Ok(Isolation::ReadCommitted),
"read_uncommitted" | "ReadUncommitted" | "readUncommitted" | "readuncommitted" => Ok(Isolation::ReadUncommitted),
_ => Err(format!("unrecognized isolation: {s}. Supported: read_committed (ReadCommitted), read_uncommitted (ReadUncommitted)")),
}
}

pub(crate) fn parse_key_val(s: &str) -> anyhow::Result<(String, String)> {
let pos = s.find('=').ok_or_else(|| {
CliError::InvalidArg(format!("invalid KEY=value: no `=` found in `{s}`"))
})?;
Ok((s[..pos].parse()?, s[pos + 1..].parse()?))
}
}
2 changes: 1 addition & 1 deletion crates/fluvio-hub-util/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ fn package_verify_sig_from_readio<R: std::io::Read>(
let tmpfile = tempdir.path().join(file_name);
let buf = std::fs::read(tmpfile)?;

let mut iv = vers
let iv = vers
.get_mut(&fnamestr)
.ok_or_else(|| HubError::PackageVerify(format!("{pkgfile} verify error")))?;
iv.seen = true;
Expand Down
2 changes: 1 addition & 1 deletion crates/fluvio-smartengine/src/engine/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub enum Lookback {
impl SmartModuleConfigBuilder {
/// add initial parameters
pub fn param(&mut self, key: impl Into<String>, value: impl Into<String>) -> &mut Self {
let mut new = self;
let new = self;
let mut params = new.params.take().unwrap_or_default();
params.insert(key.into(), value.into());
new.params = Some(params);
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.70.0"
channel = "1.71.0"

0 comments on commit e664f7e

Please sign in to comment.