Skip to content

Commit a81196e

Browse files
committed
refactor(sdk): drop stale dead_code allows
1 parent d5aeaca commit a81196e

2 files changed

Lines changed: 1 addition & 17 deletions

File tree

src/jwt.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,6 @@ pub fn ensure_access_token(
378378
/// blocking CLI function on every request so session.json, the 30s leeway
379379
/// table, no-clobber for Flag/Env, and clear-on-dead-refresh stay owned by
380380
/// the CLI — the SDK never re-implements JWT exchange.
381-
// Wired into command modules via `sdk::Api::new` incrementally; unused until
382-
// the first module migrates off the legacy ApiClient.
383-
#[allow(dead_code)]
384381
#[derive(Debug, Clone)]
385382
pub enum AuthMode {
386383
/// `HOTDATA_DATABASE_TOKEN` env var (a `databases run` child).
@@ -407,13 +404,11 @@ pub enum AuthMode {
407404
/// own `TokenManager` is bypassed for the user-JWT path and the CLI keeps
408405
/// full ownership of auth. The blocking functions run inside
409406
/// `spawn_blocking` so they don't stall the wrapper's async runtime.
410-
#[allow(dead_code)]
411407
#[derive(Debug, Clone)]
412408
pub struct CliTokenProvider {
413409
mode: AuthMode,
414410
}
415411

416-
#[allow(dead_code)]
417412
impl CliTokenProvider {
418413
pub fn new(mode: AuthMode) -> Self {
419414
Self { mode }

src/sdk.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@
2424
//! the SDK passes through unchanged; the CLI keeps full ownership of
2525
//! session.json and the refresh table.
2626
27-
// The wrapper is wired into command modules incrementally (one commit per
28-
// module). Until every call site is migrated, parts of this seam are unused;
29-
// the allow keeps the build warning-free through the transition and is removed
30-
// once api.rs is retired.
31-
#![allow(dead_code)]
32-
3327
use std::sync::Arc;
3428
use std::sync::OnceLock;
3529

@@ -470,11 +464,6 @@ impl Api {
470464
}
471465
}
472466

473-
/// Override the database id for a single query without touching config.
474-
pub fn with_database(mut self, database_id: &str) -> Self {
475-
self.database_id = Some(database_id.to_string());
476-
self
477-
}
478467

479468
pub fn workspace_id(&self) -> Option<&str> {
480469
self.workspace_id.as_deref()
@@ -1139,7 +1128,7 @@ mod tests {
11391128
.with_body(r#"{"ok":true}"#)
11401129
.create();
11411130

1142-
let api = Api::test_new(&server.url(), "test-jwt", Some("ws-1")).with_database("db-1");
1131+
let api = Api::test_new_scoped(&server.url(), "test-jwt", Some("ws-1"), None, Some("db-1"));
11431132
let (status, _body) = api
11441133
.post_raw("/query", &serde_json::json!({"sql": "select 1"}))
11451134
.expect("post_raw should succeed");

0 commit comments

Comments
 (0)