Skip to content

Commit e45c3d5

Browse files
committed
fix: gg rust 1.82 for introducing a nice breaking change in config which was not mentioned in changelog
1 parent 69f821b commit e45c3d5

File tree

11 files changed

+30
-30
lines changed

11 files changed

+30
-30
lines changed

build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
88
macos: { target_os = "macos" },
99
linux: { target_os = "linux" },
1010
posix: { target_family = "unix" },
11-
windows: { target_family = "windows" },
11+
win: { target_family = "windows" },
1212
// exclusive features
1313
smb: { all(feature = "smb", not( macos )) },
1414
smb_unix: { all(unix, feature = "smb", not(macos)) },

src/config/bookmarks.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl From<FileTransferParams> for Bookmark {
110110
address: Some(params.address),
111111
#[cfg(posix)]
112112
port: Some(params.port),
113-
#[cfg(windows)]
113+
#[cfg(win)]
114114
port: None,
115115
username: params.username,
116116
password: params.password,
@@ -172,7 +172,7 @@ impl From<Bookmark> for FileTransferParams {
172172

173173
Self::new(bookmark.protocol, ProtocolParams::Smb(params))
174174
}
175-
#[cfg(windows)]
175+
#[cfg(win)]
176176
FileTransferProtocol::Smb => {
177177
let params = TransferSmbParams::new(
178178
bookmark.address.unwrap_or_default(),
@@ -559,7 +559,7 @@ mod tests {
559559
}
560560

561561
#[test]
562-
#[cfg(windows)]
562+
#[cfg(win)]
563563
fn should_get_ftparams_from_smb_bookmark() {
564564
let bookmark: Bookmark = Bookmark {
565565
protocol: FileTransferProtocol::Smb,

src/config/bookmarks/smb.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl From<TransferSmbParams> for SmbParams {
1919
}
2020
}
2121

22-
#[cfg(windows)]
22+
#[cfg(win)]
2323
impl From<TransferSmbParams> for SmbParams {
2424
fn from(params: TransferSmbParams) -> Self {
2525
Self {

src/explorer/formatter.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl Formatter {
219219
},
220220
None => 0.to_string(),
221221
};
222-
#[cfg(windows)]
222+
#[cfg(win)]
223223
let group: String = match fsentry.metadata().gid {
224224
Some(gid) => gid.to_string(),
225225
None => 0.to_string(),
@@ -428,7 +428,7 @@ impl Formatter {
428428
},
429429
None => 0.to_string(),
430430
};
431-
#[cfg(windows)]
431+
#[cfg(win)]
432432
let username: String = match fsentry.metadata().uid {
433433
Some(uid) => uid.to_string(),
434434
None => 0.to_string(),
@@ -600,7 +600,7 @@ mod tests {
600600
fmt_time(t, "%b %d %Y %H:%M")
601601
)
602602
);
603-
#[cfg(windows)]
603+
#[cfg(win)]
604604
assert_eq!(
605605
formatter.fmt(&entry),
606606
format!(
@@ -631,7 +631,7 @@ mod tests {
631631
fmt_time(t, "%b %d %Y %H:%M")
632632
)
633633
);
634-
#[cfg(windows)]
634+
#[cfg(win)]
635635
assert_eq!(
636636
formatter.fmt(&entry),
637637
format!(
@@ -662,7 +662,7 @@ mod tests {
662662
fmt_time(t, "%b %d %Y %H:%M")
663663
)
664664
);
665-
#[cfg(windows)]
665+
#[cfg(win)]
666666
assert_eq!(
667667
formatter.fmt(&entry),
668668
format!(
@@ -693,7 +693,7 @@ mod tests {
693693
fmt_time(t, "%b %d %Y %H:%M")
694694
)
695695
);
696-
#[cfg(windows)]
696+
#[cfg(win)]
697697
assert_eq!(
698698
formatter.fmt(&entry),
699699
format!(
@@ -731,7 +731,7 @@ mod tests {
731731
fmt_time(t, "%b %d %Y %H:%M")
732732
)
733733
);
734-
#[cfg(windows)]
734+
#[cfg(win)]
735735
assert_eq!(
736736
formatter.fmt(&entry),
737737
format!(
@@ -762,7 +762,7 @@ mod tests {
762762
fmt_time(t, "%b %d %Y %H:%M")
763763
)
764764
);
765-
#[cfg(windows)]
765+
#[cfg(win)]
766766
assert_eq!(
767767
formatter.fmt(&entry),
768768
format!(

src/explorer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ mod tests {
527527
fmt_time(t, "%b %d %Y %H:%M")
528528
)
529529
);
530-
#[cfg(windows)]
530+
#[cfg(win)]
531531
assert_eq!(
532532
explorer.fmt_file(&entry),
533533
format!(

src/filetransfer/params/smb.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl SmbParams {
6262
self.password = Some(secret);
6363
}
6464

65-
#[cfg(windows)]
65+
#[cfg(win)]
6666
pub fn set_default_secret(&mut self, _secret: String) {}
6767
}
6868

@@ -108,7 +108,7 @@ mod test {
108108
}
109109

110110
#[test]
111-
#[cfg(windows)]
111+
#[cfg(win)]
112112
fn should_init_smb_params_with_optionals() {
113113
let params = SmbParams::new("localhost", "temp")
114114
.username(Some("foo"))

src/host/localhost.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ impl HostBridge for Localhost {
431431
})
432432
}
433433

434-
#[cfg(windows)]
434+
#[cfg(win)]
435435
fn symlink(&mut self, _src: &Path, _dst: &Path) -> HostResult<()> {
436436
warn!("Cannot create symlink on Windows");
437437

@@ -476,7 +476,7 @@ impl HostBridge for Localhost {
476476
}
477477
}
478478

479-
#[cfg(windows)]
479+
#[cfg(win)]
480480
fn chmod(&mut self, _path: &std::path::Path, _pex: UnixPex) -> HostResult<()> {
481481
warn!("Cannot set file mode on Windows");
482482

@@ -592,7 +592,7 @@ mod tests {
592592
}
593593

594594
#[test]
595-
#[cfg(windows)]
595+
#[cfg(win)]
596596
fn test_host_localhost_new() {
597597
let mut host: Localhost = Localhost::new(PathBuf::from("C:\\users")).ok().unwrap();
598598
assert_eq!(host.wrkdir, PathBuf::from("C:\\users"));

src/ui/activities/auth/update.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ impl AuthActivity {
271271
InputMask::Generic => &Id::HostBridge(AuthFormId::RemoteDirectory),
272272
#[cfg(posix)]
273273
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbWorkgroup),
274-
#[cfg(windows)]
274+
#[cfg(win)]
275275
InputMask::Smb => &Id::HostBridge(AuthFormId::RemoteDirectory),
276276
InputMask::AwsS3 => unreachable!("this shouldn't happen (password on s3)"),
277277
InputMask::Kube => unreachable!("this shouldn't happen (password on kube)"),
@@ -287,7 +287,7 @@ impl AuthActivity {
287287
InputMask::Generic => &Id::Remote(AuthFormId::RemoteDirectory),
288288
#[cfg(posix)]
289289
InputMask::Smb => &Id::Remote(AuthFormId::SmbWorkgroup),
290-
#[cfg(windows)]
290+
#[cfg(win)]
291291
InputMask::Smb => &Id::Remote(AuthFormId::RemoteDirectory),
292292
InputMask::AwsS3 => unreachable!("this shouldn't happen (password on s3)"),
293293
InputMask::Kube => unreachable!("this shouldn't happen (password on kube)"),
@@ -402,7 +402,7 @@ impl AuthActivity {
402402
InputMask::Generic => &Id::HostBridge(AuthFormId::Password),
403403
#[cfg(posix)]
404404
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbWorkgroup),
405-
#[cfg(windows)]
405+
#[cfg(win)]
406406
InputMask::Smb => &Id::HostBridge(AuthFormId::Password),
407407
InputMask::Kube => &Id::HostBridge(AuthFormId::KubeClientKey),
408408
InputMask::AwsS3 => &Id::HostBridge(AuthFormId::S3NewPathStyle),
@@ -418,7 +418,7 @@ impl AuthActivity {
418418
InputMask::Generic => &Id::Remote(AuthFormId::Password),
419419
#[cfg(posix)]
420420
InputMask::Smb => &Id::Remote(AuthFormId::SmbWorkgroup),
421-
#[cfg(windows)]
421+
#[cfg(win)]
422422
InputMask::Smb => &Id::Remote(AuthFormId::Password),
423423
InputMask::Kube => &Id::Remote(AuthFormId::KubeClientKey),
424424
InputMask::AwsS3 => &Id::Remote(AuthFormId::S3NewPathStyle),

src/ui/activities/auth/view.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ impl AuthActivity {
11471147
.workgroup(workgroup)
11481148
}
11491149

1150-
#[cfg(windows)]
1150+
#[cfg(win)]
11511151
pub(super) fn get_smb_params_input(&self, form_tab: FormTab) -> SmbParams {
11521152
let share: String = self.get_input_smb_share(form_tab);
11531153

@@ -1505,7 +1505,7 @@ impl AuthActivity {
15051505
params.address, params.port, params.share
15061506
)
15071507
}
1508-
#[cfg(windows)]
1508+
#[cfg(win)]
15091509
ProtocolParams::Smb(params) => {
15101510
let username: String = match params.username {
15111511
None => String::default(),
@@ -1843,7 +1843,7 @@ impl AuthActivity {
18431843
}
18441844
}
18451845

1846-
#[cfg(windows)]
1846+
#[cfg(win)]
18471847
fn get_host_bridge_smb_view(&self) -> [Id; 4] {
18481848
match self.app.focus() {
18491849
Some(
@@ -1878,7 +1878,7 @@ impl AuthActivity {
18781878
}
18791879
}
18801880

1881-
#[cfg(windows)]
1881+
#[cfg(win)]
18821882
fn get_remote_smb_view(&self) -> [Id; 4] {
18831883
match self.app.focus() {
18841884
Some(

src/ui/activities/filetransfer/components/popups.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ impl FileInfoPopup {
541541
},
542542
None => String::from("0"),
543543
};
544-
#[cfg(windows)]
544+
#[cfg(win)]
545545
let username: String = format!("{}", file.metadata().uid.unwrap_or(0));
546546
// Group
547547
#[cfg(posix)]
@@ -552,7 +552,7 @@ impl FileInfoPopup {
552552
},
553553
None => String::from("0"),
554554
};
555-
#[cfg(windows)]
555+
#[cfg(win)]
556556
let group: String = format!("{}", file.metadata().gid.unwrap_or(0));
557557
texts
558558
.add_row()

src/ui/activities/filetransfer/update.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ impl FileTransferActivity {
500500
FileExplorerTab::FindHostBridge => self.get_found_selected_entries(),
501501
FileExplorerTab::Remote => self.get_remote_selected_entries(),
502502
FileExplorerTab::FindRemote => self.get_found_selected_entries(),
503-
#[cfg(windows)]
503+
#[cfg(win)]
504504
FileExplorerTab::HostBridge | FileExplorerTab::FindHostBridge => {
505505
SelectedFile::None
506506
}

0 commit comments

Comments
 (0)