Skip to content

Commit ad7c2e5

Browse files
committed
update
1 parent 4cde2e1 commit ad7c2e5

File tree

24 files changed

+127
-86
lines changed

24 files changed

+127
-86
lines changed

cli/cli/src/repl.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use tonic::Request;
2626
#[derive(Debug, thiserror::Error)]
2727
pub enum ReplError {
2828
#[error("RPC error: {0}")]
29-
Rpc(#[from] tonic::Status),
29+
Rpc(Box<tonic::Status>),
3030
#[error("Connection failed: {0}")]
3131
Connection(String),
3232
#[error("Internal error: {0}")]
@@ -35,6 +35,12 @@ pub enum ReplError {
3535
Io(#[from] io::Error),
3636
}
3737

38+
impl From<tonic::Status> for ReplError {
39+
fn from(s: tonic::Status) -> Self {
40+
ReplError::Rpc(Box::new(s))
41+
}
42+
}
43+
3844
pub struct Repl {
3945
client: Option<FunctionStreamServiceClient<tonic::transport::Channel>>,
4046
server_host: String,

src/config/paths.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn resolve_project_root() -> std::io::Result<PathBuf> {
3838
if let Ok(exe_path) = env::current_exe() {
3939
let mut path = exe_path;
4040
path.pop();
41-
if path.file_name().map_or(false, |n| n == "bin") {
41+
if path.file_name().is_some_and(|n| n == "bin") {
4242
path.pop();
4343
}
4444
return Ok(path);

src/coordinator/coordinator.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ use super::execution_context::ExecutionContext;
2525

2626
pub struct Coordinator {}
2727

28+
impl Default for Coordinator {
29+
fn default() -> Self {
30+
Self::new()
31+
}
32+
}
33+
2834
impl Coordinator {
2935
pub fn new() -> Self {
3036
Self {}

src/coordinator/execution/executor.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ impl Executor {
5959
}
6060

6161
impl PlanVisitor for Executor {
62+
#[allow(clippy::redundant_closure_call)]
6263
fn visit_create_function(
6364
&self,
6465
plan: &CreateFunctionPlan,
@@ -98,6 +99,7 @@ impl PlanVisitor for Executor {
9899
PlanVisitorResult::Execute(result)
99100
}
100101

102+
#[allow(clippy::redundant_closure_call)]
101103
fn visit_drop_function(
102104
&self,
103105
plan: &DropFunctionPlan,
@@ -148,23 +150,25 @@ impl PlanVisitor for Executor {
148150
PlanVisitorResult::Execute(result)
149151
}
150152

153+
#[allow(clippy::redundant_closure_call)]
151154
fn visit_show_functions(
152155
&self,
153156
_plan: &ShowFunctionsPlan,
154157
_context: &PlanVisitorContext,
155158
) -> PlanVisitorResult {
156-
let result = (|| -> Result<ExecuteResult, ExecuteError> {
159+
let result = {
157160
let functions = self.task_manager.list_all_functions();
158161

159162
Ok(ExecuteResult::ok_with_data(
160163
format!("Found {} task(s)", functions.len()),
161164
ShowFunctionsResult::new(functions),
162165
))
163-
})();
166+
};
164167

165168
PlanVisitorResult::Execute(result)
166169
}
167170

171+
#[allow(clippy::redundant_closure_call)]
168172
fn visit_create_python_function(
169173
&self,
170174
plan: &CreatePythonFunctionPlan,

src/coordinator/execution_context.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ use std::time::{Duration, Instant};
1616
static EXECUTION_ID_GENERATOR: AtomicU64 = AtomicU64::new(1);
1717

1818
#[derive(Debug)]
19+
#[allow(dead_code)]
1920
pub struct ExecutionContext {
2021
pub execution_id: u64,
2122
pub start_time: Instant,
2223
pub timeout: Duration,
2324
}
2425

26+
#[allow(dead_code)]
2527
impl ExecutionContext {
2628
pub fn new() -> Self {
2729
Self {

src/coordinator/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// limitations under the License.
1212

1313
mod analyze;
14+
#[allow(clippy::module_inception)]
1415
mod coordinator;
1516
mod dataset;
1617
mod execution;

src/coordinator/plan/optimizer.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ impl LogicalPlanner {
3232
}
3333
}
3434

35+
#[allow(dead_code)]
3536
pub fn with_optimizers(optimizers: Vec<Box<dyn PlanOptimizer>>) -> Self {
3637
Self { optimizers }
3738
}
3839

40+
#[allow(dead_code)]
3941
pub fn add_optimizer(&mut self, optimizer: Box<dyn PlanOptimizer>) {
4042
self.optimizers.push(optimizer);
4143
}

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
// Library crate for function-stream
1414

15+
#![allow(dead_code)]
16+
1517
pub mod config;
1618
pub mod coordinator;
1719
pub mod logging;

src/main.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
// See the License for the specific language governing permissions and
1111
// limitations under the License.
1212

13+
#![allow(dead_code)]
14+
1315
mod config;
1416
mod coordinator;
1517
mod logging;
@@ -32,10 +34,10 @@ impl ServerHandle {
3234
pub fn stop(mut self) {
3335
log::info!("Initiating server shutdown sequence...");
3436

35-
if let Some(tx) = self.shutdown_tx.take() {
36-
if tx.send(()).is_err() {
37-
log::warn!("Server shutdown signal failed to send (receiver dropped)");
38-
}
37+
if let Some(tx) = self.shutdown_tx.take()
38+
&& tx.send(()).is_err()
39+
{
40+
log::warn!("Server shutdown signal failed to send (receiver dropped)");
3941
}
4042

4143
if let Some(handle) = self.join_handle.take() {

src/runtime/buffer_and_event/stream_element/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
// See the License for the specific language governing permissions and
1111
// limitations under the License.
1212

13+
#[allow(clippy::module_inception)]
1314
mod stream_element;

0 commit comments

Comments
 (0)