Use default port method

This commit is contained in:
veeso
2021-05-05 22:07:49 +02:00
parent 4f1e505a7a
commit 1ddbd0aa4e

View File

@@ -137,11 +137,6 @@ impl AuthActivity {
.build(),
)),
);
// Calc default port
let default_port: String = String::from(match default_protocol {
FileTransferProtocol::Ftp(_) => "21",
FileTransferProtocol::Sftp | FileTransferProtocol::Scp => "22",
});
// Port
self.view.mount(
super::COMPONENT_INPUT_PORT,
@@ -152,7 +147,7 @@ impl AuthActivity {
.with_label(String::from("Port number"))
.with_input(InputType::Number)
.with_input_len(5)
.with_value(default_port)
.with_value(Self::get_default_port_for_protocol(default_protocol).to_string())
.build(),
)),
);