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" },
|
||||
linux: { target_os = "linux" },
|
||||
posix: { target_family = "unix" },
|
||||
windows: { target_family = "windows" },
|
||||
win: { target_family = "windows" },
|
||||
// exclusive features
|
||||
smb: { all(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),
|
||||
#[cfg(posix)]
|
||||
port: Some(params.port),
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
port: None,
|
||||
username: params.username,
|
||||
password: params.password,
|
||||
@@ -172,7 +172,7 @@ impl From<Bookmark> for FileTransferParams {
|
||||
|
||||
Self::new(bookmark.protocol, ProtocolParams::Smb(params))
|
||||
}
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
FileTransferProtocol::Smb => {
|
||||
let params = TransferSmbParams::new(
|
||||
bookmark.address.unwrap_or_default(),
|
||||
@@ -559,7 +559,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
fn should_get_ftparams_from_smb_bookmark() {
|
||||
let bookmark: Bookmark = Bookmark {
|
||||
protocol: FileTransferProtocol::Smb,
|
||||
|
||||
@@ -19,7 +19,7 @@ impl From<TransferSmbParams> for SmbParams {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
impl From<TransferSmbParams> for SmbParams {
|
||||
fn from(params: TransferSmbParams) -> Self {
|
||||
Self {
|
||||
|
||||
@@ -219,7 +219,7 @@ impl Formatter {
|
||||
},
|
||||
None => 0.to_string(),
|
||||
};
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
let group: String = match fsentry.metadata().gid {
|
||||
Some(gid) => gid.to_string(),
|
||||
None => 0.to_string(),
|
||||
@@ -428,7 +428,7 @@ impl Formatter {
|
||||
},
|
||||
None => 0.to_string(),
|
||||
};
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
let username: String = match fsentry.metadata().uid {
|
||||
Some(uid) => uid.to_string(),
|
||||
None => 0.to_string(),
|
||||
@@ -600,7 +600,7 @@ mod tests {
|
||||
fmt_time(t, "%b %d %Y %H:%M")
|
||||
)
|
||||
);
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
assert_eq!(
|
||||
formatter.fmt(&entry),
|
||||
format!(
|
||||
@@ -631,7 +631,7 @@ mod tests {
|
||||
fmt_time(t, "%b %d %Y %H:%M")
|
||||
)
|
||||
);
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
assert_eq!(
|
||||
formatter.fmt(&entry),
|
||||
format!(
|
||||
@@ -662,7 +662,7 @@ mod tests {
|
||||
fmt_time(t, "%b %d %Y %H:%M")
|
||||
)
|
||||
);
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
assert_eq!(
|
||||
formatter.fmt(&entry),
|
||||
format!(
|
||||
@@ -693,7 +693,7 @@ mod tests {
|
||||
fmt_time(t, "%b %d %Y %H:%M")
|
||||
)
|
||||
);
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
assert_eq!(
|
||||
formatter.fmt(&entry),
|
||||
format!(
|
||||
@@ -731,7 +731,7 @@ mod tests {
|
||||
fmt_time(t, "%b %d %Y %H:%M")
|
||||
)
|
||||
);
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
assert_eq!(
|
||||
formatter.fmt(&entry),
|
||||
format!(
|
||||
@@ -762,7 +762,7 @@ mod tests {
|
||||
fmt_time(t, "%b %d %Y %H:%M")
|
||||
)
|
||||
);
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
assert_eq!(
|
||||
formatter.fmt(&entry),
|
||||
format!(
|
||||
|
||||
@@ -527,7 +527,7 @@ mod tests {
|
||||
fmt_time(t, "%b %d %Y %H:%M")
|
||||
)
|
||||
);
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
assert_eq!(
|
||||
explorer.fmt_file(&entry),
|
||||
format!(
|
||||
|
||||
@@ -62,7 +62,7 @@ impl SmbParams {
|
||||
self.password = Some(secret);
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
pub fn set_default_secret(&mut self, _secret: String) {}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
fn should_init_smb_params_with_optionals() {
|
||||
let params = SmbParams::new("localhost", "temp")
|
||||
.username(Some("foo"))
|
||||
|
||||
@@ -431,7 +431,7 @@ impl HostBridge for Localhost {
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
fn symlink(&mut self, _src: &Path, _dst: &Path) -> HostResult<()> {
|
||||
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<()> {
|
||||
warn!("Cannot set file mode on Windows");
|
||||
|
||||
@@ -592,7 +592,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
fn test_host_localhost_new() {
|
||||
let mut host: Localhost = Localhost::new(PathBuf::from("C:\\users")).ok().unwrap();
|
||||
assert_eq!(host.wrkdir, PathBuf::from("C:\\users"));
|
||||
|
||||
@@ -271,7 +271,7 @@ impl AuthActivity {
|
||||
InputMask::Generic => &Id::HostBridge(AuthFormId::RemoteDirectory),
|
||||
#[cfg(posix)]
|
||||
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbWorkgroup),
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
InputMask::Smb => &Id::HostBridge(AuthFormId::RemoteDirectory),
|
||||
InputMask::AwsS3 => unreachable!("this shouldn't happen (password on s3)"),
|
||||
InputMask::Kube => unreachable!("this shouldn't happen (password on kube)"),
|
||||
@@ -287,7 +287,7 @@ impl AuthActivity {
|
||||
InputMask::Generic => &Id::Remote(AuthFormId::RemoteDirectory),
|
||||
#[cfg(posix)]
|
||||
InputMask::Smb => &Id::Remote(AuthFormId::SmbWorkgroup),
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
InputMask::Smb => &Id::Remote(AuthFormId::RemoteDirectory),
|
||||
InputMask::AwsS3 => unreachable!("this shouldn't happen (password on s3)"),
|
||||
InputMask::Kube => unreachable!("this shouldn't happen (password on kube)"),
|
||||
@@ -402,7 +402,7 @@ impl AuthActivity {
|
||||
InputMask::Generic => &Id::HostBridge(AuthFormId::Password),
|
||||
#[cfg(posix)]
|
||||
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbWorkgroup),
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
InputMask::Smb => &Id::HostBridge(AuthFormId::Password),
|
||||
InputMask::Kube => &Id::HostBridge(AuthFormId::KubeClientKey),
|
||||
InputMask::AwsS3 => &Id::HostBridge(AuthFormId::S3NewPathStyle),
|
||||
@@ -418,7 +418,7 @@ impl AuthActivity {
|
||||
InputMask::Generic => &Id::Remote(AuthFormId::Password),
|
||||
#[cfg(posix)]
|
||||
InputMask::Smb => &Id::Remote(AuthFormId::SmbWorkgroup),
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
InputMask::Smb => &Id::Remote(AuthFormId::Password),
|
||||
InputMask::Kube => &Id::Remote(AuthFormId::KubeClientKey),
|
||||
InputMask::AwsS3 => &Id::Remote(AuthFormId::S3NewPathStyle),
|
||||
|
||||
@@ -1147,7 +1147,7 @@ impl AuthActivity {
|
||||
.workgroup(workgroup)
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
pub(super) fn get_smb_params_input(&self, form_tab: FormTab) -> SmbParams {
|
||||
let share: String = self.get_input_smb_share(form_tab);
|
||||
|
||||
@@ -1505,7 +1505,7 @@ impl AuthActivity {
|
||||
params.address, params.port, params.share
|
||||
)
|
||||
}
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
ProtocolParams::Smb(params) => {
|
||||
let username: String = match params.username {
|
||||
None => String::default(),
|
||||
@@ -1843,7 +1843,7 @@ impl AuthActivity {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
fn get_host_bridge_smb_view(&self) -> [Id; 4] {
|
||||
match self.app.focus() {
|
||||
Some(
|
||||
@@ -1878,7 +1878,7 @@ impl AuthActivity {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
fn get_remote_smb_view(&self) -> [Id; 4] {
|
||||
match self.app.focus() {
|
||||
Some(
|
||||
|
||||
@@ -541,7 +541,7 @@ impl FileInfoPopup {
|
||||
},
|
||||
None => String::from("0"),
|
||||
};
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
let username: String = format!("{}", file.metadata().uid.unwrap_or(0));
|
||||
// Group
|
||||
#[cfg(posix)]
|
||||
@@ -552,7 +552,7 @@ impl FileInfoPopup {
|
||||
},
|
||||
None => String::from("0"),
|
||||
};
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
let group: String = format!("{}", file.metadata().gid.unwrap_or(0));
|
||||
texts
|
||||
.add_row()
|
||||
|
||||
@@ -500,7 +500,7 @@ impl FileTransferActivity {
|
||||
FileExplorerTab::FindHostBridge => self.get_found_selected_entries(),
|
||||
FileExplorerTab::Remote => self.get_remote_selected_entries(),
|
||||
FileExplorerTab::FindRemote => self.get_found_selected_entries(),
|
||||
#[cfg(windows)]
|
||||
#[cfg(win)]
|
||||
FileExplorerTab::HostBridge | FileExplorerTab::FindHostBridge => {
|
||||
SelectedFile::None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user