diff --git a/build.rs b/build.rs index 4d571f5..d6b0acc 100644 --- a/build.rs +++ b/build.rs @@ -8,7 +8,7 @@ fn main() -> Result<(), Box> { 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)) }, diff --git a/src/config/bookmarks.rs b/src/config/bookmarks.rs index 55ba16c..6906523 100644 --- a/src/config/bookmarks.rs +++ b/src/config/bookmarks.rs @@ -110,7 +110,7 @@ impl From 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 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, diff --git a/src/config/bookmarks/smb.rs b/src/config/bookmarks/smb.rs index 1ccb137..31b8366 100644 --- a/src/config/bookmarks/smb.rs +++ b/src/config/bookmarks/smb.rs @@ -19,7 +19,7 @@ impl From for SmbParams { } } -#[cfg(windows)] +#[cfg(win)] impl From for SmbParams { fn from(params: TransferSmbParams) -> Self { Self { diff --git a/src/explorer/formatter.rs b/src/explorer/formatter.rs index 5d57488..bc3812b 100644 --- a/src/explorer/formatter.rs +++ b/src/explorer/formatter.rs @@ -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!( diff --git a/src/explorer/mod.rs b/src/explorer/mod.rs index 54aa9c6..ff15935 100644 --- a/src/explorer/mod.rs +++ b/src/explorer/mod.rs @@ -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!( diff --git a/src/filetransfer/params/smb.rs b/src/filetransfer/params/smb.rs index 779062c..411eb3a 100644 --- a/src/filetransfer/params/smb.rs +++ b/src/filetransfer/params/smb.rs @@ -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")) diff --git a/src/host/localhost.rs b/src/host/localhost.rs index 94ccda5..3cfee60 100644 --- a/src/host/localhost.rs +++ b/src/host/localhost.rs @@ -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")); diff --git a/src/ui/activities/auth/update.rs b/src/ui/activities/auth/update.rs index 627a967..3345437 100644 --- a/src/ui/activities/auth/update.rs +++ b/src/ui/activities/auth/update.rs @@ -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), diff --git a/src/ui/activities/auth/view.rs b/src/ui/activities/auth/view.rs index 51c2697..df19e6f 100644 --- a/src/ui/activities/auth/view.rs +++ b/src/ui/activities/auth/view.rs @@ -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( diff --git a/src/ui/activities/filetransfer/components/popups.rs b/src/ui/activities/filetransfer/components/popups.rs index 4ea671f..76e36f8 100644 --- a/src/ui/activities/filetransfer/components/popups.rs +++ b/src/ui/activities/filetransfer/components/popups.rs @@ -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() diff --git a/src/ui/activities/filetransfer/update.rs b/src/ui/activities/filetransfer/update.rs index 6d872e9..5eaecca 100644 --- a/src/ui/activities/filetransfer/update.rs +++ b/src/ui/activities/filetransfer/update.rs @@ -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 }