fix: cfg unix forbidden in rust .82
Some checks are pending
Install.sh / build (push) Waiting to run
Linux / build (push) Waiting to run
MacOS / build (push) Waiting to run
Windows / build (push) Waiting to run

This commit is contained in:
veeso
2024-10-21 10:32:50 +02:00
parent 11559d0962
commit 69f821baef
22 changed files with 95 additions and 95 deletions

View File

@@ -108,7 +108,7 @@ impl From<FileTransferParams> for Bookmark {
smb: Some(SmbParams::from(params.clone())),
protocol,
address: Some(params.address),
#[cfg(unix)]
#[cfg(posix)]
port: Some(params.port),
#[cfg(windows)]
port: None,
@@ -159,7 +159,7 @@ impl From<Bookmark> for FileTransferParams {
let params = KubeProtocolParams::from(params);
Self::new(bookmark.protocol, ProtocolParams::Kube(params))
}
#[cfg(unix)]
#[cfg(posix)]
FileTransferProtocol::Smb => {
let params = TransferSmbParams::new(
bookmark.address.unwrap_or_default(),
@@ -521,7 +521,7 @@ mod tests {
}
#[test]
#[cfg(unix)]
#[cfg(posix)]
fn should_get_ftparams_from_smb_bookmark() {
let bookmark: Bookmark = Bookmark {
protocol: FileTransferProtocol::Smb,

View File

@@ -9,7 +9,7 @@ pub struct SmbParams {
pub workgroup: Option<String>,
}
#[cfg(unix)]
#[cfg(posix)]
impl From<TransferSmbParams> for SmbParams {
fn from(params: TransferSmbParams) -> Self {
Self {

View File

@@ -422,14 +422,14 @@ mod tests {
let host = hosts.bookmarks.get("smb").unwrap();
assert_eq!(host.address.as_deref().unwrap(), "localhost");
assert_eq!(host.port.unwrap(), 445);
#[cfg(unix)]
#[cfg(posix)]
assert_eq!(host.username.as_deref().unwrap(), "test");
#[cfg(unix)]
#[cfg(posix)]
assert_eq!(host.password.as_deref().unwrap(), "test");
let smb = host.smb.as_ref().unwrap();
assert_eq!(smb.share.as_str(), "temp");
#[cfg(unix)]
#[cfg(posix)]
assert_eq!(smb.workgroup.as_deref().unwrap(), "test");
}