Browse Source

Run `cargo clippy fix`

tags/v0.0.0-test-pr-120
Philipp Oppermann 3 years ago
parent
commit
f08634e00d
Failed to extract signature
5 changed files with 10 additions and 9 deletions
  1. +3
    -3
      binaries/cli/src/build.rs
  2. +4
    -3
      binaries/cli/src/check.rs
  3. +1
    -1
      binaries/cli/src/graph/mod.rs
  4. +1
    -1
      examples/iceoryx/node/src/main.rs
  5. +1
    -1
      libraries/communication-layer/src/lib.rs

+ 3
- 3
binaries/cli/src/build.rs View File

@@ -18,7 +18,7 @@ pub fn build(dataflow: &Path) -> eyre::Result<()> {
match &node.kind {
dora_core::descriptor::NodeKind::Runtime(runtime_node) => {
for operator in &runtime_node.operators {
run_build_command(operator.config.build.as_deref(), &working_dir)
run_build_command(operator.config.build.as_deref(), working_dir)
.with_context(|| {
format!(
"build command failed for operator `{}/{}`",
@@ -28,12 +28,12 @@ pub fn build(dataflow: &Path) -> eyre::Result<()> {
}
}
dora_core::descriptor::NodeKind::Custom(custom_node) => {
run_build_command(custom_node.build.as_deref(), &working_dir).with_context(
run_build_command(custom_node.build.as_deref(), working_dir).with_context(
|| format!("build command failed for custom node `{}`", node.id),
)?
}
dora_core::descriptor::NodeKind::Operator(operator) => {
run_build_command(operator.config.build.as_deref(), &working_dir).with_context(
run_build_command(operator.config.build.as_deref(), working_dir).with_context(
|| {
format!(
"build command failed for operator `{}/{}`",


+ 4
- 3
binaries/cli/src/check.rs View File

@@ -8,7 +8,7 @@ use std::{env::consts::EXE_EXTENSION, path::Path};

pub fn check(dataflow_path: &Path, runtime: &Path) -> eyre::Result<()> {
let runtime = runtime.with_extension(EXE_EXTENSION);
let descriptor = read_descriptor(&dataflow_path).wrap_err_with(|| {
let descriptor = read_descriptor(dataflow_path).wrap_err_with(|| {
format!(
"failed to read dataflow descriptor at {}",
dataflow_path.display()
@@ -108,7 +108,7 @@ fn check_input(
nodes: &[dora_core::descriptor::ResolvedNode],
input_id_str: &str,
) -> Result<(), eyre::ErrReport> {
Ok(match mapping {
match mapping {
InputMapping::Timer { interval: _ } => {}
InputMapping::User(UserInputMapping {
source,
@@ -162,5 +162,6 @@ fn check_input(
}
}
}
})
};
Ok(())
}

+ 1
- 1
binaries/cli/src/graph/mod.rs View File

@@ -11,7 +11,7 @@ pub fn visualize_as_html(dataflow: &Path) -> eyre::Result<String> {
}

pub fn visualize_as_mermaid(dataflow: &Path) -> eyre::Result<String> {
let descriptor = read_descriptor(&dataflow)
let descriptor = read_descriptor(dataflow)
.with_context(|| format!("failed to read dataflow at `{}`", dataflow.display()))?;
let visualized = descriptor
.visualize_as_mermaid()


+ 1
- 1
examples/iceoryx/node/src/main.rs View File

@@ -18,7 +18,7 @@ fn main() -> eyre::Result<()> {
let random: u64 = rand::random();
let data: &[u8] = &random.to_le_bytes();
operator.send_output(&output, input.metadata(), data.len(), |out| {
out.copy_from_slice(&data);
out.copy_from_slice(data);
})?;
}
other => eprintln!("Ignoring unexpected input `{other}`"),


+ 1
- 1
libraries/communication-layer/src/lib.rs View File

@@ -54,7 +54,7 @@ pub trait Publisher: Send + Sync {
/// can be used to construct the message in-place.
fn publish(&self, data: &[u8]) -> Result<(), BoxError> {
let mut sample = self.prepare(data.len())?;
sample.as_mut_slice().copy_from_slice(&data);
sample.as_mut_slice().copy_from_slice(data);
sample.publish()?;
Ok(())
}


Loading…
Cancel
Save