Skip to content

Commit

Permalink
IcyEngine: Format module is now pub
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger committed May 5, 2024
1 parent 057e7a6 commit 8d8bb05
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/icy_engine/src/formats/pcboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use super::SaveOptions;
pub(crate) const HEX_TABLE: &[u8; 16] = b"0123456789ABCDEF";

#[derive(Default)]
pub(super) struct PCBoard {}
pub struct PCBoard {}

impl OutputFormat for PCBoard {
fn get_file_extension(&self) -> &str {
Expand Down
2 changes: 1 addition & 1 deletion crates/icy_engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub use parsers::*;
mod caret;
pub use caret::*;

mod formats;
pub mod formats;
pub use formats::*;

mod tdf_font;
Expand Down
2 changes: 1 addition & 1 deletion crates/icy_play/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition.workspace = true
license.workspace = true

description = "Plays icy_anim files for bbs systems."
repository = "https://github.com/mkrueger/icy_draw"
repository = "https://github.com/mkrueger/icy_tools"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
15 changes: 14 additions & 1 deletion crates/icy_term/src/data/addresses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,8 @@ fn parse_address(value: &Value) -> Address {
"raw" => result.protocol = ConnectionType::Raw,
"websocket(true)" => result.protocol = ConnectionType::Websocket,
"websocket(false)" => result.protocol = ConnectionType::SecureWebsocket,
"modem" => result.protocol = ConnectionType::Modem,
"serial" => result.protocol = ConnectionType::Serial,
_ => {}
}
}
Expand Down Expand Up @@ -648,7 +650,18 @@ fn store_address(file: &mut File, addr: &Address) -> TerminalResult<()> {
}
file.write_all(format!("address = \"{}\"\n", escape(&addr.address)).as_bytes())?;
if addr.protocol != ConnectionType::default() {
file.write_all(format!("protocol = \"{:?}\"\n", addr.protocol).as_bytes())?;
let protocol = match addr.protocol {
ConnectionType::Telnet => "Telnet",
ConnectionType::SSH => "SSH",
ConnectionType::Raw => "Raw",
ConnectionType::Websocket => "WebSocket(true)",
ConnectionType::SecureWebsocket => "WebSocket(false)",
ConnectionType::Modem => "Modem",
ConnectionType::Serial => "Serial",
_ => "",
};

file.write_all(format!("protocol = \"{}\"\n", protocol).as_bytes())?;
}
if !addr.user_name.is_empty() {
file.write_all(format!("user_name = \"{}\"\n", escape(&addr.user_name)).as_bytes())?;
Expand Down

0 comments on commit 8d8bb05

Please sign in to comment.