Compare commits

..

No commits in common. "a424751d60e98894de478f9a4c6d732083fc05cd" and "9c8d60bec167ea55f1fc22bc41c853ecf4d285e1" have entirely different histories.

3 changed files with 7 additions and 9 deletions

View file

@ -11,8 +11,6 @@ jobs:
uses: actions/checkout@v4
- name: 🦀 Setup Rust cache
uses: https://github.com/Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: 📎 Clippy
run: cargo clippy --all -- -D warnings
- name: 🧪 Test

View file

@ -67,7 +67,7 @@ impl App {
Self
}
fn new_state(&self) -> Result<AppState, Error> {
fn new_state(&self) -> AppState {
AppState::new()
}
@ -76,7 +76,7 @@ impl App {
let listener = tokio::net::TcpListener::bind(address).await?;
tracing::info!("Listening on http://{address}");
let state = self.new_state()?;
let state = self.new_state();
let real_ip_header = state.i.cfg.load().real_ip_header.clone();
let router = Router::new()
// Prevent search indexing since artifactview serves temporary artifacts
@ -445,13 +445,13 @@ impl App {
}
impl AppState {
pub fn new() -> Result<Self, Error> {
let cfg = Config::new()?;
pub fn new() -> Self {
let cfg = Config::default();
let cache = Cache::new(cfg.clone());
let api = ArtifactApi::new(cfg.clone());
Ok(Self {
Self {
i: Arc::new(AppInner { cfg, cache, api }),
})
}
}
/// Run garbage collection in the background if necessary

View file

@ -91,7 +91,7 @@ impl Default for ConfigData {
impl Default for Config {
fn default() -> Self {
Self::from_data(ConfigData::default()).unwrap()
Self::new().expect("Could not initialize config")
}
}