Skip to content

Commit

Permalink
Update to point to new factorio-file-parser lib
Browse files Browse the repository at this point in the history
  • Loading branch information
circlesabound committed Apr 15, 2024
1 parent a44ddf4 commit e7e2f09
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bytes = "1.0"
chrono = { version = "0.4.37", features = [ "serde" ] }
derive_more = "0.99"
env_logger = "0.11.3"
factorio-mod-settings-parser = { git = "https://github.com/circlesabound/factorio-mod-settings-parser", rev = "a9fecd6" }
factorio-file-parser = { git = "https://github.com/circlesabound/factorio-file-parser", rev = "172a700" }
futures = "0.3"
futures-util = "0.3"
http = "1.0"
Expand Down
8 changes: 4 additions & 4 deletions src/agent/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ pub enum Error {
Aggregate(Vec<Error>),

// Generic wrappers around external error types
FactorioDatFileSerde(factorio_file_parser::Error),
Io(std::io::Error),
Json(serde_json::error::Error),
ModSettingsSerde(factorio_mod_settings_parser::Error),
Rcon(rcon::Error),
Reqwest(reqwest::Error),
TomlDe(toml::de::Error),
Expand All @@ -52,9 +52,9 @@ impl From<serde_json::error::Error> for Error {
}
}

impl From<factorio_mod_settings_parser::Error> for Error {
fn from(e: factorio_mod_settings_parser::Error) -> Self {
Error::ModSettingsSerde(e)
impl From<factorio_file_parser::Error> for Error {
fn from(e: factorio_file_parser::Error) -> Self {
Error::FactorioDatFileSerde(e)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/agent/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{
},
};
use chrono::Utc;
use factorio_mod_settings_parser::ModSettings;
use factorio_file_parser::ModSettings;
use fctrl::schema::*;
use futures::Sink;
use futures_util::{
Expand Down
2 changes: 1 addition & 1 deletion src/agent/server/mods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
path::{Path, PathBuf},
};

use factorio_mod_settings_parser::ModSettings;
use factorio_file_parser::ModSettings;
use futures::future;
use lazy_static::lazy_static;
use log::{debug, error, info};
Expand Down
10 changes: 5 additions & 5 deletions src/mgmt-server/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ pub enum Error {
Rpc(String),

// Specific errors
FactorioDatFileParseError(factorio_file_parser::Error),
DiscordAlertingDisabled,
InvalidLink,
ModSettingsNotInitialised,
ModSettingsParseError(factorio_mod_settings_parser::Error),
SaveNotFound,
SecretsNotInitialised,

Expand All @@ -51,9 +51,9 @@ impl std::fmt::Display for Error {
}
}

impl From<factorio_mod_settings_parser::Error> for Error {
fn from(e: factorio_mod_settings_parser::Error) -> Self {
Error::ModSettingsParseError(e)
impl From<factorio_file_parser::Error> for Error {
fn from(e: factorio_file_parser::Error) -> Self {
Error::FactorioDatFileParseError(e)
}
}

Expand Down Expand Up @@ -121,7 +121,7 @@ impl<'r> Responder<'r, 'static> for Error {
| Error::Io(_)
| Error::Json(_)
| Error::Reqwest(_)
| Error::ModSettingsParseError(_)
| Error::FactorioDatFileParseError(_)
| Error::Misconfiguration(_)
| Error::NotImplemented
| Error::Rpc(_) => Status::InternalServerError,
Expand Down
4 changes: 2 additions & 2 deletions src/mgmt-server/routes/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
time::Duration,
};

use factorio_mod_settings_parser::ModSettings;
use factorio_file_parser::ModSettings;
use fctrl::schema::{
mgmt_server_rest::*, FactorioVersion, ModSettingsBytes, RconConfig, SecretsObject, ServerSettingsConfig, ServerStartSaveFile, ServerStatus
};
Expand All @@ -13,7 +13,7 @@ use rocket::{get, post, put};
use rocket::{http::Status, State};

use crate::{
auth::AuthorizedUser, clients::AgentApiClient, guards::HostHeader, link_download::{LinkDownloadManager, LinkDownloadTarget}, routes::ContentDisposition, ws::WebSocketServer
auth::AuthorizedUser, clients::AgentApiClient, guards::HostHeader, link_download::{LinkDownloadManager, LinkDownloadTarget}, ws::WebSocketServer
};
use crate::{error::Result, routes::WsStreamingResponder};

Expand Down

0 comments on commit e7e2f09

Please sign in to comment.