style: apply rustfmt across all crates and demos

Consistent formatting pass: line wrapping, import sorting, trailing
whitespace removal, let-chain indentation, merged derive attributes,
and unsafe block reformatting.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
osobh
2026-04-12 07:01:58 -07:00
co-authored by Claude Opus 4.6
parent bc88a14fa1
commit 02d382d5f6
302 changed files with 1805 additions and 1590 deletions
@@ -3,7 +3,6 @@
//! Implements a transformer-based model for learning cell representations
//! from sparse gene expression data.
/// Configuration for the Cell Transformer.
#[derive(Debug, Clone)]
pub struct CellTransformerConfig {
@@ -53,7 +52,7 @@ pub struct CellTransformer {
impl CellTransformer {
/// Create a new Cell Transformer with random initialization.
#[must_use]
#[must_use]
pub fn new(config: CellTransformerConfig) -> Self {
use rand::SeedableRng;
use rand_distr::{Distribution, Normal};
@@ -89,7 +88,7 @@ impl CellTransformer {
}
/// Encode a batch of cells into embeddings.
#[must_use]
#[must_use]
pub fn encode(&self, gene_indices: &[Vec<usize>], values: &[Vec<f32>]) -> Vec<Vec<f32>> {
let batch_size = gene_indices.len();
let mut embeddings = Vec::with_capacity(batch_size);
@@ -132,7 +131,7 @@ impl CellTransformer {
}
/// Get the hidden dimension.
#[must_use]
#[must_use]
pub fn hidden_dim(&self) -> usize {
self.config.hidden_dim
}