Working on logging

This commit is contained in:
veeso
2021-05-16 22:26:16 +02:00
parent 1e3c859ae0
commit c1b3511c06
5 changed files with 258 additions and 87 deletions

View File

@@ -319,14 +319,14 @@ impl std::string::ToString for FileTransferProtocol {
}
impl std::str::FromStr for FileTransferProtocol {
type Err = ();
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s.to_ascii_uppercase().as_str() {
"FTP" => Ok(FileTransferProtocol::Ftp(false)),
"FTPS" => Ok(FileTransferProtocol::Ftp(true)),
"SCP" => Ok(FileTransferProtocol::Scp),
"SFTP" => Ok(FileTransferProtocol::Sftp),
_ => Err(()),
_ => Err(s.to_string()),
}
}
}