mirror of
https://github.com/veeso/termscp.git
synced 2025-12-06 17:15:35 -08:00
fix: gg rust 1.82 for introducing a nice breaking change in config which was not mentioned in changelog
This commit is contained in:
2
build.rs
2
build.rs
@@ -8,7 +8,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
macos: { target_os = "macos" },
|
macos: { target_os = "macos" },
|
||||||
linux: { target_os = "linux" },
|
linux: { target_os = "linux" },
|
||||||
posix: { target_family = "unix" },
|
posix: { target_family = "unix" },
|
||||||
windows: { target_family = "windows" },
|
win: { target_family = "windows" },
|
||||||
// exclusive features
|
// exclusive features
|
||||||
smb: { all(feature = "smb", not( macos )) },
|
smb: { all(feature = "smb", not( macos )) },
|
||||||
smb_unix: { all(unix, feature = "smb", not(macos)) },
|
smb_unix: { all(unix, feature = "smb", not(macos)) },
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ impl From<FileTransferParams> for Bookmark {
|
|||||||
address: Some(params.address),
|
address: Some(params.address),
|
||||||
#[cfg(posix)]
|
#[cfg(posix)]
|
||||||
port: Some(params.port),
|
port: Some(params.port),
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
port: None,
|
port: None,
|
||||||
username: params.username,
|
username: params.username,
|
||||||
password: params.password,
|
password: params.password,
|
||||||
@@ -172,7 +172,7 @@ impl From<Bookmark> for FileTransferParams {
|
|||||||
|
|
||||||
Self::new(bookmark.protocol, ProtocolParams::Smb(params))
|
Self::new(bookmark.protocol, ProtocolParams::Smb(params))
|
||||||
}
|
}
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
FileTransferProtocol::Smb => {
|
FileTransferProtocol::Smb => {
|
||||||
let params = TransferSmbParams::new(
|
let params = TransferSmbParams::new(
|
||||||
bookmark.address.unwrap_or_default(),
|
bookmark.address.unwrap_or_default(),
|
||||||
@@ -559,7 +559,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
fn should_get_ftparams_from_smb_bookmark() {
|
fn should_get_ftparams_from_smb_bookmark() {
|
||||||
let bookmark: Bookmark = Bookmark {
|
let bookmark: Bookmark = Bookmark {
|
||||||
protocol: FileTransferProtocol::Smb,
|
protocol: FileTransferProtocol::Smb,
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ impl From<TransferSmbParams> for SmbParams {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
impl From<TransferSmbParams> for SmbParams {
|
impl From<TransferSmbParams> for SmbParams {
|
||||||
fn from(params: TransferSmbParams) -> Self {
|
fn from(params: TransferSmbParams) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ impl Formatter {
|
|||||||
},
|
},
|
||||||
None => 0.to_string(),
|
None => 0.to_string(),
|
||||||
};
|
};
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
let group: String = match fsentry.metadata().gid {
|
let group: String = match fsentry.metadata().gid {
|
||||||
Some(gid) => gid.to_string(),
|
Some(gid) => gid.to_string(),
|
||||||
None => 0.to_string(),
|
None => 0.to_string(),
|
||||||
@@ -428,7 +428,7 @@ impl Formatter {
|
|||||||
},
|
},
|
||||||
None => 0.to_string(),
|
None => 0.to_string(),
|
||||||
};
|
};
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
let username: String = match fsentry.metadata().uid {
|
let username: String = match fsentry.metadata().uid {
|
||||||
Some(uid) => uid.to_string(),
|
Some(uid) => uid.to_string(),
|
||||||
None => 0.to_string(),
|
None => 0.to_string(),
|
||||||
@@ -600,7 +600,7 @@ mod tests {
|
|||||||
fmt_time(t, "%b %d %Y %H:%M")
|
fmt_time(t, "%b %d %Y %H:%M")
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
formatter.fmt(&entry),
|
formatter.fmt(&entry),
|
||||||
format!(
|
format!(
|
||||||
@@ -631,7 +631,7 @@ mod tests {
|
|||||||
fmt_time(t, "%b %d %Y %H:%M")
|
fmt_time(t, "%b %d %Y %H:%M")
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
formatter.fmt(&entry),
|
formatter.fmt(&entry),
|
||||||
format!(
|
format!(
|
||||||
@@ -662,7 +662,7 @@ mod tests {
|
|||||||
fmt_time(t, "%b %d %Y %H:%M")
|
fmt_time(t, "%b %d %Y %H:%M")
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
formatter.fmt(&entry),
|
formatter.fmt(&entry),
|
||||||
format!(
|
format!(
|
||||||
@@ -693,7 +693,7 @@ mod tests {
|
|||||||
fmt_time(t, "%b %d %Y %H:%M")
|
fmt_time(t, "%b %d %Y %H:%M")
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
formatter.fmt(&entry),
|
formatter.fmt(&entry),
|
||||||
format!(
|
format!(
|
||||||
@@ -731,7 +731,7 @@ mod tests {
|
|||||||
fmt_time(t, "%b %d %Y %H:%M")
|
fmt_time(t, "%b %d %Y %H:%M")
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
formatter.fmt(&entry),
|
formatter.fmt(&entry),
|
||||||
format!(
|
format!(
|
||||||
@@ -762,7 +762,7 @@ mod tests {
|
|||||||
fmt_time(t, "%b %d %Y %H:%M")
|
fmt_time(t, "%b %d %Y %H:%M")
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
formatter.fmt(&entry),
|
formatter.fmt(&entry),
|
||||||
format!(
|
format!(
|
||||||
|
|||||||
@@ -527,7 +527,7 @@ mod tests {
|
|||||||
fmt_time(t, "%b %d %Y %H:%M")
|
fmt_time(t, "%b %d %Y %H:%M")
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
explorer.fmt_file(&entry),
|
explorer.fmt_file(&entry),
|
||||||
format!(
|
format!(
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ impl SmbParams {
|
|||||||
self.password = Some(secret);
|
self.password = Some(secret);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
pub fn set_default_secret(&mut self, _secret: String) {}
|
pub fn set_default_secret(&mut self, _secret: String) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
fn should_init_smb_params_with_optionals() {
|
fn should_init_smb_params_with_optionals() {
|
||||||
let params = SmbParams::new("localhost", "temp")
|
let params = SmbParams::new("localhost", "temp")
|
||||||
.username(Some("foo"))
|
.username(Some("foo"))
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ impl HostBridge for Localhost {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
fn symlink(&mut self, _src: &Path, _dst: &Path) -> HostResult<()> {
|
fn symlink(&mut self, _src: &Path, _dst: &Path) -> HostResult<()> {
|
||||||
warn!("Cannot create symlink on Windows");
|
warn!("Cannot create symlink on Windows");
|
||||||
|
|
||||||
@@ -476,7 +476,7 @@ impl HostBridge for Localhost {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
fn chmod(&mut self, _path: &std::path::Path, _pex: UnixPex) -> HostResult<()> {
|
fn chmod(&mut self, _path: &std::path::Path, _pex: UnixPex) -> HostResult<()> {
|
||||||
warn!("Cannot set file mode on Windows");
|
warn!("Cannot set file mode on Windows");
|
||||||
|
|
||||||
@@ -592,7 +592,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
fn test_host_localhost_new() {
|
fn test_host_localhost_new() {
|
||||||
let mut host: Localhost = Localhost::new(PathBuf::from("C:\\users")).ok().unwrap();
|
let mut host: Localhost = Localhost::new(PathBuf::from("C:\\users")).ok().unwrap();
|
||||||
assert_eq!(host.wrkdir, PathBuf::from("C:\\users"));
|
assert_eq!(host.wrkdir, PathBuf::from("C:\\users"));
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ impl AuthActivity {
|
|||||||
InputMask::Generic => &Id::HostBridge(AuthFormId::RemoteDirectory),
|
InputMask::Generic => &Id::HostBridge(AuthFormId::RemoteDirectory),
|
||||||
#[cfg(posix)]
|
#[cfg(posix)]
|
||||||
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbWorkgroup),
|
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbWorkgroup),
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
InputMask::Smb => &Id::HostBridge(AuthFormId::RemoteDirectory),
|
InputMask::Smb => &Id::HostBridge(AuthFormId::RemoteDirectory),
|
||||||
InputMask::AwsS3 => unreachable!("this shouldn't happen (password on s3)"),
|
InputMask::AwsS3 => unreachable!("this shouldn't happen (password on s3)"),
|
||||||
InputMask::Kube => unreachable!("this shouldn't happen (password on kube)"),
|
InputMask::Kube => unreachable!("this shouldn't happen (password on kube)"),
|
||||||
@@ -287,7 +287,7 @@ impl AuthActivity {
|
|||||||
InputMask::Generic => &Id::Remote(AuthFormId::RemoteDirectory),
|
InputMask::Generic => &Id::Remote(AuthFormId::RemoteDirectory),
|
||||||
#[cfg(posix)]
|
#[cfg(posix)]
|
||||||
InputMask::Smb => &Id::Remote(AuthFormId::SmbWorkgroup),
|
InputMask::Smb => &Id::Remote(AuthFormId::SmbWorkgroup),
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
InputMask::Smb => &Id::Remote(AuthFormId::RemoteDirectory),
|
InputMask::Smb => &Id::Remote(AuthFormId::RemoteDirectory),
|
||||||
InputMask::AwsS3 => unreachable!("this shouldn't happen (password on s3)"),
|
InputMask::AwsS3 => unreachable!("this shouldn't happen (password on s3)"),
|
||||||
InputMask::Kube => unreachable!("this shouldn't happen (password on kube)"),
|
InputMask::Kube => unreachable!("this shouldn't happen (password on kube)"),
|
||||||
@@ -402,7 +402,7 @@ impl AuthActivity {
|
|||||||
InputMask::Generic => &Id::HostBridge(AuthFormId::Password),
|
InputMask::Generic => &Id::HostBridge(AuthFormId::Password),
|
||||||
#[cfg(posix)]
|
#[cfg(posix)]
|
||||||
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbWorkgroup),
|
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbWorkgroup),
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
InputMask::Smb => &Id::HostBridge(AuthFormId::Password),
|
InputMask::Smb => &Id::HostBridge(AuthFormId::Password),
|
||||||
InputMask::Kube => &Id::HostBridge(AuthFormId::KubeClientKey),
|
InputMask::Kube => &Id::HostBridge(AuthFormId::KubeClientKey),
|
||||||
InputMask::AwsS3 => &Id::HostBridge(AuthFormId::S3NewPathStyle),
|
InputMask::AwsS3 => &Id::HostBridge(AuthFormId::S3NewPathStyle),
|
||||||
@@ -418,7 +418,7 @@ impl AuthActivity {
|
|||||||
InputMask::Generic => &Id::Remote(AuthFormId::Password),
|
InputMask::Generic => &Id::Remote(AuthFormId::Password),
|
||||||
#[cfg(posix)]
|
#[cfg(posix)]
|
||||||
InputMask::Smb => &Id::Remote(AuthFormId::SmbWorkgroup),
|
InputMask::Smb => &Id::Remote(AuthFormId::SmbWorkgroup),
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
InputMask::Smb => &Id::Remote(AuthFormId::Password),
|
InputMask::Smb => &Id::Remote(AuthFormId::Password),
|
||||||
InputMask::Kube => &Id::Remote(AuthFormId::KubeClientKey),
|
InputMask::Kube => &Id::Remote(AuthFormId::KubeClientKey),
|
||||||
InputMask::AwsS3 => &Id::Remote(AuthFormId::S3NewPathStyle),
|
InputMask::AwsS3 => &Id::Remote(AuthFormId::S3NewPathStyle),
|
||||||
|
|||||||
@@ -1147,7 +1147,7 @@ impl AuthActivity {
|
|||||||
.workgroup(workgroup)
|
.workgroup(workgroup)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
pub(super) fn get_smb_params_input(&self, form_tab: FormTab) -> SmbParams {
|
pub(super) fn get_smb_params_input(&self, form_tab: FormTab) -> SmbParams {
|
||||||
let share: String = self.get_input_smb_share(form_tab);
|
let share: String = self.get_input_smb_share(form_tab);
|
||||||
|
|
||||||
@@ -1505,7 +1505,7 @@ impl AuthActivity {
|
|||||||
params.address, params.port, params.share
|
params.address, params.port, params.share
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
ProtocolParams::Smb(params) => {
|
ProtocolParams::Smb(params) => {
|
||||||
let username: String = match params.username {
|
let username: String = match params.username {
|
||||||
None => String::default(),
|
None => String::default(),
|
||||||
@@ -1843,7 +1843,7 @@ impl AuthActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
fn get_host_bridge_smb_view(&self) -> [Id; 4] {
|
fn get_host_bridge_smb_view(&self) -> [Id; 4] {
|
||||||
match self.app.focus() {
|
match self.app.focus() {
|
||||||
Some(
|
Some(
|
||||||
@@ -1878,7 +1878,7 @@ impl AuthActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
fn get_remote_smb_view(&self) -> [Id; 4] {
|
fn get_remote_smb_view(&self) -> [Id; 4] {
|
||||||
match self.app.focus() {
|
match self.app.focus() {
|
||||||
Some(
|
Some(
|
||||||
|
|||||||
@@ -541,7 +541,7 @@ impl FileInfoPopup {
|
|||||||
},
|
},
|
||||||
None => String::from("0"),
|
None => String::from("0"),
|
||||||
};
|
};
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
let username: String = format!("{}", file.metadata().uid.unwrap_or(0));
|
let username: String = format!("{}", file.metadata().uid.unwrap_or(0));
|
||||||
// Group
|
// Group
|
||||||
#[cfg(posix)]
|
#[cfg(posix)]
|
||||||
@@ -552,7 +552,7 @@ impl FileInfoPopup {
|
|||||||
},
|
},
|
||||||
None => String::from("0"),
|
None => String::from("0"),
|
||||||
};
|
};
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
let group: String = format!("{}", file.metadata().gid.unwrap_or(0));
|
let group: String = format!("{}", file.metadata().gid.unwrap_or(0));
|
||||||
texts
|
texts
|
||||||
.add_row()
|
.add_row()
|
||||||
|
|||||||
@@ -500,7 +500,7 @@ impl FileTransferActivity {
|
|||||||
FileExplorerTab::FindHostBridge => self.get_found_selected_entries(),
|
FileExplorerTab::FindHostBridge => self.get_found_selected_entries(),
|
||||||
FileExplorerTab::Remote => self.get_remote_selected_entries(),
|
FileExplorerTab::Remote => self.get_remote_selected_entries(),
|
||||||
FileExplorerTab::FindRemote => self.get_found_selected_entries(),
|
FileExplorerTab::FindRemote => self.get_found_selected_entries(),
|
||||||
#[cfg(windows)]
|
#[cfg(win)]
|
||||||
FileExplorerTab::HostBridge | FileExplorerTab::FindHostBridge => {
|
FileExplorerTab::HostBridge | FileExplorerTab::FindHostBridge => {
|
||||||
SelectedFile::None
|
SelectedFile::None
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user