提交 27728f3e authored 作者: Serhij S's avatar Serhij S

timeout fix

上级 5f8f3fa2
[package] [package]
name = "roboplc-cli" name = "roboplc-cli"
version = "0.1.5" version = "0.1.6"
edition = "2021" edition = "2021"
authors = ["Serhij S. <div@altertech.com>"] authors = ["Serhij S. <div@altertech.com>"]
license = "Apache-2.0" license = "Apache-2.0"
......
...@@ -352,13 +352,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { ...@@ -352,13 +352,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.map(String::from); .map(String::from);
} }
if timeout.is_none() { if timeout.is_none() {
timeout = Some(u64::try_from( let toml_timeout = value.get("remote").and_then(|v| v.get("timeout"));
value if let Some(t) = toml_timeout {
.get("remote") timeout = Some(u64::try_from(
.and_then(|v| v.get("timeout")) t.as_integer().ok_or("Invalid timeout (must be integer)")?,
.and_then(toml::Value::as_integer) )?);
.ok_or("Invalid timeout (must be integer)")?, }
)?);
} }
robo_toml.replace(value); robo_toml.replace(value);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论