Skip to content

Commit 2b16822

Browse files
committed
chore: fmt
1 parent f59a1cc commit 2b16822

File tree

7 files changed

+9
-20
lines changed

7 files changed

+9
-20
lines changed

packages/cubejs-backend-native/src/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ impl SqlGenerator for NodeSqlGenerator {
398398
impl Drop for NodeSqlGenerator {
399399
fn drop(&mut self) {
400400
let channel = self.channel.clone();
401-
/// Safety: Safe, because on_track take is used only for dropping
402-
let sql_generator_obj = self.sql_generator_obj.take().unwrap();
401+
// Safety: Safe, because on_track take is used only for dropping
402+
let sql_generator_obj = self.sql_generator_obj.take().expect("Unable to take sql_generator_object while dropping NodeSqlGenerator, it was already taken");
403403

404404
channel.send(move |mut cx| {
405405
let _ = match Arc::try_unwrap(sql_generator_obj) {

packages/cubejs-backend-native/src/gateway/auth_middleware.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
use crate::gateway::http_error::HttpError;
22
use crate::gateway::state::ApiGatewayStateRef;
3-
use crate::gateway::{
4-
ApiGatewayState, GatewayAuthContextRef, GatewayAuthService, GatewayCheckAuthRequest,
5-
};
3+
use crate::gateway::{GatewayAuthContextRef, GatewayAuthService, GatewayCheckAuthRequest};
64
use axum::extract::State;
7-
use axum::http::{header, HeaderMap, HeaderValue, Response, StatusCode};
85
use axum::response::IntoResponse;
9-
use std::sync::Arc;
106

117
#[derive(Debug, Clone)]
128
pub struct AuthExtension {

packages/cubejs-backend-native/src/gateway/handlers/stream.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::gateway::auth_middleware::AuthExtension;
22
use crate::gateway::http_error::HttpError;
33
use crate::gateway::state::ApiGatewayStateRef;
4-
use crate::gateway::{ApiGatewayRouterBuilder, ApiGatewayState};
54
use axum::extract::State;
65
use axum::http::StatusCode;
76
use axum::response::IntoResponse;

packages/cubejs-backend-native/src/gateway/router.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
use crate::gateway::gateway_auth_middleware;
12
use crate::gateway::handlers::stream_handler_v2;
23
use crate::gateway::state::ApiGatewayStateRef;
3-
use crate::gateway::{gateway_auth_middleware, ApiGatewayState};
44
use axum::handler::Handler;
55
use axum::routing::{get, MethodRouter};
66
use axum::Router;
7-
use tower::ServiceBuilder;
87

98
#[derive(Debug, Clone)]
109
pub struct ApiGatewayRouterBuilder {

packages/cubejs-backend-native/src/gateway/server.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
use crate::gateway::state::ApiGatewayStateRef;
2-
use crate::gateway::{ApiGatewayRouterBuilder, ApiGatewayState};
2+
use crate::gateway::ApiGatewayRouterBuilder;
33
use async_trait::async_trait;
4-
use cubesql::config::injection::Injector;
54
use cubesql::config::processing_loop::{ProcessingLoop, ShutdownMode};
65
use cubesql::CubeError;
76
use std::sync::Arc;
87
use tokio::net::TcpListener;
98
use tokio::sync::{watch, Mutex};
10-
use tower::ServiceBuilder;
119

1210
pub trait ApiGatewayServer: ProcessingLoop {}
1311

packages/cubejs-backend-native/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ pub mod transport;
2323
pub mod utils;
2424

2525
use crate::config::NodeConfigurationImpl;
26-
use cubesql::telemetry::{LocalReporter, ReportingLogger};
2726
use cubesql::CubeError;
2827
use neon::prelude::*;
2928
use once_cell::sync::OnceCell;
30-
use simple_logger::SimpleLogger;
3129
use tokio::runtime::{Builder, Runtime};
3230

3331
pub fn tokio_runtime_node<'a, C: Context<'a>>(cx: &mut C) -> NeonResult<&'static Runtime> {

packages/cubejs-backend-native/src/logger.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl LogReporter for NodeBridgeLogger {
3535
let extra = serde_json::to_string(&EventBox { event: props }).unwrap();
3636

3737
let channel = self.channel.clone();
38-
/// Safety: Safe, because on_track take is used only for dropping
38+
// Safety: Safe, because on_track take is used only for dropping
3939
let on_track = self
4040
.on_track
4141
.as_ref()
@@ -52,10 +52,9 @@ impl LogReporter for NodeBridgeLogger {
5252
impl Drop for NodeBridgeLogger {
5353
fn drop(&mut self) {
5454
let channel = self.channel.clone();
55-
let on_track = self
56-
.on_track
57-
.take()
58-
.expect("NodeBridgeLogger.on_track was t already dropped");
55+
let on_track = self.on_track.take().expect(
56+
"Unable to take on_track while dropping NodeBridgeLogger, it was already taken",
57+
);
5958

6059
channel.send(move |mut cx| {
6160
let _ = match Arc::try_unwrap(on_track) {

0 commit comments

Comments
 (0)