Browse Source

Made some changes to make clippy happy

tags/v0.3.12-fix
Chrislearn Young 6 months ago
parent
commit
cc9eeac472
5 changed files with 8 additions and 6 deletions
  1. +2
    -2
      apis/rust/node/src/node/arrow_utils.rs
  2. +1
    -0
      apis/rust/node/src/node/mod.rs
  3. +1
    -1
      libraries/core/src/descriptor/validate.rs
  4. +1
    -1
      libraries/extensions/telemetry/tracing/src/telemetry.rs
  5. +3
    -2
      node-hub/openai-proxy-server/src/main.rs

+ 2
- 2
apis/rust/node/src/node/arrow_utils.rs View File

@@ -11,7 +11,7 @@ fn required_data_size_inner(array: &ArrayData, next_offset: &mut usize) {
for (buffer, spec) in array.buffers().iter().zip(&layout.buffers) {
// consider alignment padding
if let BufferSpec::FixedWidth { alignment, .. } = spec {
*next_offset = (*next_offset + alignment - 1) / alignment * alignment;
*next_offset = (*next_offset).div_ceil(*alignment) * alignment;
}
*next_offset += buffer.len();
}
@@ -42,7 +42,7 @@ fn copy_array_into_sample_inner(
);
// add alignment padding
if let BufferSpec::FixedWidth { alignment, .. } = spec {
*next_offset = (*next_offset + alignment - 1) / alignment * alignment;
*next_offset = (*next_offset).div_ceil(*alignment) * alignment;
}

target_buffer[*next_offset..][..len].copy_from_slice(buffer.as_slice());


+ 1
- 0
apis/rust/node/src/node/mod.rs View File

@@ -44,6 +44,7 @@ mod drop_stream;

pub const ZERO_COPY_THRESHOLD: usize = 4096;

#[allow(dead_code)]
enum TokioRuntime {
Runtime(Runtime),
Handle(Handle),


+ 1
- 1
libraries/core/src/descriptor/validate.rs View File

@@ -54,7 +54,7 @@ pub fn check_dataflow(
};
}
},
dora_message::descriptor::NodeSource::GitBranch { repo, rev } => {
dora_message::descriptor::NodeSource::GitBranch { .. } => {
info!("skipping check for node with git source");
}
},


+ 1
- 1
libraries/extensions/telemetry/tracing/src/telemetry.rs View File

@@ -6,7 +6,7 @@ use std::collections::HashMap;

struct MetadataMap<'a>(HashMap<&'a str, &'a str>);

impl<'a> Extractor for MetadataMap<'a> {
impl Extractor for MetadataMap<'_> {
/// Get a value for a key from the MetadataMap. If the value can't be converted to &str, returns None
fn get(&self, key: &str) -> Option<&str> {
self.0.get(key).cloned()


+ 3
- 2
node-hub/openai-proxy-server/src/main.rs View File

@@ -96,7 +96,7 @@ async fn main() -> eyre::Result<()> {
)
.context("failed to send dora output")?;

reply_channels.push_back((reply, 0 as u64, request.model));
reply_channels.push_back((reply, 0_u64, request.model));
}
},
dora_node_api::merged::MergedEvent::Dora(event) => match event {
@@ -112,7 +112,7 @@ async fn main() -> eyre::Result<()> {
let data = data.as_string::<i32>();
let string = data.iter().fold("".to_string(), |mut acc, s| {
if let Some(s) = s {
acc.push_str("\n");
acc.push('\n');
acc.push_str(s);
}
acc
@@ -164,6 +164,7 @@ async fn main() -> eyre::Result<()> {
Ok(())
}

#[allow(clippy::large_enum_variant)]
enum ServerEvent {
Result(eyre::Result<()>),
ChatCompletionRequest {


Loading…
Cancel
Save