refactor: centralize constants, eliminate unwraps, remove dead code, resolve TODOs
- R13+R16: Replace .expect() with .context()? in main.rs and identity.rs - R17+R18+R19: Fix unwrap() calls in helpers and js-engine - R20+R21: Remove #[allow(dead_code)] annotations and delete truly dead code - R22-R26: Create constants.rs module, replace 21 hardcoded values across 12 files - R28+R29: LND/DWN timeouts already present — verified - R30-R33: Remove TODO comments, implement marketplace payment check Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -64,29 +64,6 @@ impl DevDataManager {
|
||||
// This is a no-op by default, but can be extended
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Get all app data directories
|
||||
#[allow(dead_code)]
|
||||
pub async fn list_app_data_dirs(&self) -> Result<Vec<String>> {
|
||||
if !self.dev_data_dir.exists() {
|
||||
return Ok(vec![]);
|
||||
}
|
||||
|
||||
let mut entries = fs::read_dir(&self.dev_data_dir)
|
||||
.await
|
||||
.with_context(|| format!("Failed to read dev data directory: {:?}", self.dev_data_dir))?;
|
||||
|
||||
let mut app_ids = Vec::new();
|
||||
while let Some(entry) = entries.next_entry().await? {
|
||||
if entry.file_type().await?.is_dir() {
|
||||
if let Some(name) = entry.file_name().to_str() {
|
||||
app_ids.push(name.to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(app_ids)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -247,16 +247,4 @@ impl DevContainerOrchestrator {
|
||||
archipelago_container::ContainerState::Unknown(_) => Ok("unknown".to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
/// Get port mapping for an app
|
||||
#[allow(dead_code)]
|
||||
pub fn get_port_mapping(&self, app_id: &str) -> Option<Vec<u16>> {
|
||||
self.port_manager.get_port_mapping(app_id).ok().flatten()
|
||||
}
|
||||
|
||||
/// Get Bitcoin simulator
|
||||
#[allow(dead_code)]
|
||||
pub fn bitcoin_simulator(&self) -> &Arc<BitcoinSimulator> {
|
||||
&self.bitcoin_simulator
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user