提交 45daf83d authored 作者: Serhij S's avatar Serhij S

clippy fmt

上级 ee91e281
...@@ -40,8 +40,7 @@ jobs: ...@@ -40,8 +40,7 @@ jobs:
-A clippy::missing_errors_doc \ -A clippy::missing_errors_doc \
-A clippy::single_match \ -A clippy::single_match \
-A clippy::uninlined_format_args \ -A clippy::uninlined_format_args \
-A clippy::no_effect_underscore_binding \ -A clippy::no_effect_underscore_binding
-A clippy::large_futures
derive-test: derive-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
...@@ -69,8 +68,7 @@ jobs: ...@@ -69,8 +68,7 @@ jobs:
-A clippy::missing_errors_doc \ -A clippy::missing_errors_doc \
-A clippy::single_match \ -A clippy::single_match \
-A clippy::uninlined_format_args \ -A clippy::uninlined_format_args \
-A clippy::no_effect_underscore_binding \ -A clippy::no_effect_underscore_binding
-A clippy::large_futures
cli-test: cli-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
...@@ -98,5 +96,4 @@ jobs: ...@@ -98,5 +96,4 @@ jobs:
-A clippy::missing_errors_doc \ -A clippy::missing_errors_doc \
-A clippy::single_match \ -A clippy::single_match \
-A clippy::uninlined_format_args \ -A clippy::uninlined_format_args \
-A clippy::no_effect_underscore_binding \ -A clippy::no_effect_underscore_binding
-A clippy::large_futures
...@@ -360,14 +360,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { ...@@ -360,14 +360,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
url = value url = value
.get("remote") .get("remote")
.and_then(|v| v.get("url")) .and_then(|v| v.get("url"))
.and_then(|v| v.as_str()) .and_then(toml::Value::as_str)
.map(String::from); .map(String::from);
} }
if key.is_none() { if key.is_none() {
key = value key = value
.get("remote") .get("remote")
.and_then(|v| v.get("key")) .and_then(|v| v.get("key"))
.and_then(|v| v.as_str()) .and_then(toml::Value::as_str)
.map(String::from); .map(String::from);
} }
if timeout.is_none() { if timeout.is_none() {
......
...@@ -59,7 +59,7 @@ impl<T: DataDeliveryPolicy + Clone> Hub<T> { ...@@ -59,7 +59,7 @@ impl<T: DataDeliveryPolicy + Clone> Hub<T> {
pub fn send(&self, message: T) { pub fn send(&self, message: T) {
macro_rules! send { macro_rules! send {
($sub: expr, $msg: expr) => { ($sub: expr, $msg: expr) => {
let _ = $sub.tx.send($msg); let _r = $sub.tx.send($msg);
}; };
} }
// clones matching subscribers to keep the internal mutex unlocked and avoid deadlocks // clones matching subscribers to keep the internal mutex unlocked and avoid deadlocks
......
...@@ -51,7 +51,7 @@ impl<T: DataDeliveryPolicy + Clone> Hub<T> { ...@@ -51,7 +51,7 @@ impl<T: DataDeliveryPolicy + Clone> Hub<T> {
pub async fn send(&self, message: T) { pub async fn send(&self, message: T) {
macro_rules! send { macro_rules! send {
($sub: expr, $msg: expr) => { ($sub: expr, $msg: expr) => {
let _ = $sub.tx.send($msg).await; let _r = $sub.tx.send($msg).await;
}; };
} }
// clones matching subscribers to keep the internal mutex unlocked and avoid deadlocks // clones matching subscribers to keep the internal mutex unlocked and avoid deadlocks
......
...@@ -172,7 +172,7 @@ impl Builder { ...@@ -172,7 +172,7 @@ impl Builder {
name name
))); )));
} }
builder = builder.name(name.to_owned()); builder = builder.name(name.clone());
} }
if let Some(stack_size) = self.stack_size { if let Some(stack_size) = self.stack_size {
builder = builder.stack_size(stack_size); builder = builder.stack_size(stack_size);
...@@ -327,7 +327,7 @@ impl<T> Task<T> { ...@@ -327,7 +327,7 @@ impl<T> Task<T> {
/// Applies new real-time params /// Applies new real-time params
pub fn apply_rt_params(&mut self, rt_params: RTParams) -> Result<()> { pub fn apply_rt_params(&mut self, rt_params: RTParams) -> Result<()> {
if let Err(e) = apply_thread_params(self.tid, &rt_params, false) { if let Err(e) = apply_thread_params(self.tid, &rt_params, false) {
let _ = apply_thread_params(self.tid, &self.rt_params, false); let _r = apply_thread_params(self.tid, &self.rt_params, false);
return Err(e); return Err(e);
} }
self.rt_params = rt_params; self.rt_params = rt_params;
...@@ -388,7 +388,7 @@ impl<'scope, T> ScopedTask<'scope, T> { ...@@ -388,7 +388,7 @@ impl<'scope, T> ScopedTask<'scope, T> {
/// Applies new real-time params /// Applies new real-time params
pub fn apply_rt_params(&mut self, rt_params: RTParams) -> Result<()> { pub fn apply_rt_params(&mut self, rt_params: RTParams) -> Result<()> {
if let Err(e) = apply_thread_params(self.tid, &rt_params, false) { if let Err(e) = apply_thread_params(self.tid, &rt_params, false) {
let _ = apply_thread_params(self.tid, &self.rt_params, false); let _r = apply_thread_params(self.tid, &self.rt_params, false);
return Err(e); return Err(e);
} }
self.rt_params = rt_params; self.rt_params = rt_params;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论