Skip to content

Commit 13a123b

Browse files
luckfamousaclaude
andcommitted
Fix formatting issues
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 65329cb commit 13a123b

6 files changed

Lines changed: 19 additions & 28 deletions

File tree

‎dicom-rst-plugin-api/src/lib.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ macro_rules! declare_plugin {
178178
$caps
179179
}
180180

181-
extern "C" fn initialize(
182-
config: $crate::PluginConfig,
183-
) -> $crate::FfiResult<()> {
181+
extern "C" fn initialize(config: $crate::PluginConfig) -> $crate::FfiResult<()> {
184182
let init_fn: fn($crate::PluginConfig) -> $crate::FfiResult<()> = $init;
185183
init_fn(config)
186184
}

‎dicom-rst-plugin-api/src/qido.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ pub trait QidoPlugin: Send + Sync {
2222
///
2323
/// # Returns
2424
/// A stream of DICOM objects matching the search criteria, or an error.
25-
fn search(&self, request: FfiSearchRequest)
26-
-> FfiFuture<FfiResult<FfiDicomObjectStreamBox>>;
25+
fn search(&self, request: FfiSearchRequest) -> FfiFuture<FfiResult<FfiDicomObjectStreamBox>>;
2726

2827
/// Check if the plugin is healthy and ready to serve requests.
2928
///

‎dicom-rst-plugin-api/src/wado.rs‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ pub trait WadoPlugin: Send + Sync {
2626
///
2727
/// # Returns
2828
/// A stream of DICOM files, or an error.
29-
fn retrieve(&self, request: FfiRetrieveRequest)
30-
-> FfiFuture<FfiResult<FfiDicomFileStreamBox>>;
29+
fn retrieve(&self, request: FfiRetrieveRequest) -> FfiFuture<FfiResult<FfiDicomFileStreamBox>>;
3130

3231
/// Render a DICOM instance to an image.
3332
///
@@ -50,8 +49,7 @@ pub trait WadoPlugin: Send + Sync {
5049
///
5150
/// # Returns
5251
/// A stream of DICOM files (metadata will be extracted by host), or an error.
53-
fn metadata(&self, request: FfiMetadataRequest)
54-
-> FfiFuture<FfiResult<FfiDicomFileStreamBox>>;
52+
fn metadata(&self, request: FfiMetadataRequest) -> FfiFuture<FfiResult<FfiDicomFileStreamBox>>;
5553

5654
/// Check if the plugin is healthy and ready to serve requests.
5755
#[sabi(last_prefix_field)]

‎src/backend/plugin/adapters.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,9 @@ impl crate::api::stow::StowService for PluginStowAdapter {
360360
.filter_map(|obj| {
361361
let mut buffer = Vec::new();
362362
match obj.write_all(&mut buffer) {
363-
Ok(()) => Some(dicom_rst_plugin_api::FfiDicomFile { data: buffer.into() }),
363+
Ok(()) => Some(dicom_rst_plugin_api::FfiDicomFile {
364+
data: buffer.into(),
365+
}),
364366
Err(e) => {
365367
error!("Failed to serialize DICOM object for plugin: {e}");
366368
None

‎src/backend/plugin/registry.rs‎

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ impl PluginRegistry {
5858
})?;
5959

6060
// Get the root module
61-
let module = header
62-
.init_root_module::<PluginModuleRef>()
63-
.map_err(|e| PluginLoadError::InitFailed {
61+
let module = header.init_root_module::<PluginModuleRef>().map_err(|e| {
62+
PluginLoadError::InitFailed {
6463
path: path.display().to_string(),
6564
source: e,
66-
})?;
65+
}
66+
})?;
6767

6868
// Get plugin info
6969
let id = (module.plugin_id())().to_string();
@@ -84,25 +84,19 @@ impl PluginRegistry {
8484

8585
// Create service instances (wrapped in Arc for sharing)
8686
let qido = if capabilities.supports_qido {
87-
(module.create_qido_service())()
88-
.into_option()
89-
.map(Arc::new)
87+
(module.create_qido_service())().into_option().map(Arc::new)
9088
} else {
9189
None
9290
};
9391

9492
let wado = if capabilities.supports_wado {
95-
(module.create_wado_service())()
96-
.into_option()
97-
.map(Arc::new)
93+
(module.create_wado_service())().into_option().map(Arc::new)
9894
} else {
9995
None
10096
};
10197

10298
let stow = if capabilities.supports_stow {
103-
(module.create_stow_service())()
104-
.into_option()
105-
.map(Arc::new)
99+
(module.create_stow_service())().into_option().map(Arc::new)
106100
} else {
107101
None
108102
};

‎src/main.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ use crate::backend::plugin::PluginRegistry;
1313
use crate::config::{AppConfig, HttpServerConfig};
1414
use crate::types::AE;
1515
use association::pool::AssociationPools;
16+
use axum::extract::{DefaultBodyLimit, Request};
17+
use axum::response::Response;
18+
use std::net::SocketAddr;
1619
#[cfg(feature = "plugins")]
1720
use std::path::PathBuf;
1821
#[cfg(feature = "plugins")]
1922
use std::sync::Arc;
20-
#[cfg(feature = "plugins")]
21-
use tokio::sync::RwLock;
22-
use axum::extract::{DefaultBodyLimit, Request};
23-
use axum::response::Response;
24-
use std::net::SocketAddr;
2523
use std::time::Duration;
2624
use tokio::net::TcpListener;
2725
use tokio::signal;
26+
#[cfg(feature = "plugins")]
27+
use tokio::sync::RwLock;
2828
use tower_http::cors::CorsLayer;
2929
use tower_http::timeout::TimeoutLayer;
3030
use tower_http::trace;

0 commit comments

Comments
 (0)