Skip to content

Commit

Permalink
fix: gg rust 1.82 for introducing a nice breaking change in config wh…
Browse files Browse the repository at this point in the history
…ich was not mentioned in changelog
  • Loading branch information
veeso committed Oct 21, 2024
1 parent 69f821b commit e45c3d5
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)) },
Expand Down
6 changes: 3 additions & 3 deletions src/config/bookmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/config/bookmarks/smb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl From<TransferSmbParams> for SmbParams {
}
}

#[cfg(windows)]
#[cfg(win)]
impl From<TransferSmbParams> for SmbParams {
fn from(params: TransferSmbParams) -> Self {
Self {
Expand Down
16 changes: 8 additions & 8 deletions src/explorer/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -600,7 +600,7 @@ mod tests {
fmt_time(t, "%b %d %Y %H:%M")
)
);
#[cfg(windows)]
#[cfg(win)]
assert_eq!(
formatter.fmt(&entry),
format!(
Expand Down Expand Up @@ -631,7 +631,7 @@ mod tests {
fmt_time(t, "%b %d %Y %H:%M")
)
);
#[cfg(windows)]
#[cfg(win)]
assert_eq!(
formatter.fmt(&entry),
format!(
Expand Down Expand Up @@ -662,7 +662,7 @@ mod tests {
fmt_time(t, "%b %d %Y %H:%M")
)
);
#[cfg(windows)]
#[cfg(win)]
assert_eq!(
formatter.fmt(&entry),
format!(
Expand Down Expand Up @@ -693,7 +693,7 @@ mod tests {
fmt_time(t, "%b %d %Y %H:%M")
)
);
#[cfg(windows)]
#[cfg(win)]
assert_eq!(
formatter.fmt(&entry),
format!(
Expand Down Expand Up @@ -731,7 +731,7 @@ mod tests {
fmt_time(t, "%b %d %Y %H:%M")
)
);
#[cfg(windows)]
#[cfg(win)]
assert_eq!(
formatter.fmt(&entry),
format!(
Expand Down Expand Up @@ -762,7 +762,7 @@ mod tests {
fmt_time(t, "%b %d %Y %H:%M")
)
);
#[cfg(windows)]
#[cfg(win)]
assert_eq!(
formatter.fmt(&entry),
format!(
Expand Down
2 changes: 1 addition & 1 deletion src/explorer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
4 changes: 2 additions & 2 deletions src/filetransfer/params/smb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl SmbParams {
self.password = Some(secret);
}

#[cfg(windows)]
#[cfg(win)]
pub fn set_default_secret(&mut self, _secret: String) {}
}

Expand Down Expand Up @@ -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"))
Expand Down
6 changes: 3 additions & 3 deletions src/host/localhost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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"));
Expand Down
8 changes: 4 additions & 4 deletions src/ui/activities/auth/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)"),
Expand All @@ -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)"),
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand Down
8 changes: 4 additions & 4 deletions src/ui/activities/auth/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -1843,7 +1843,7 @@ impl AuthActivity {
}
}

#[cfg(windows)]
#[cfg(win)]
fn get_host_bridge_smb_view(&self) -> [Id; 4] {
match self.app.focus() {
Some(
Expand Down Expand Up @@ -1878,7 +1878,7 @@ impl AuthActivity {
}
}

#[cfg(windows)]
#[cfg(win)]
fn get_remote_smb_view(&self) -> [Id; 4] {
match self.app.focus() {
Some(
Expand Down
4 changes: 2 additions & 2 deletions src/ui/activities/filetransfer/components/popups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/ui/activities/filetransfer/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e45c3d5

Please sign in to comment.