Skip to content

Commit

Permalink
[temp] fix
Browse files Browse the repository at this point in the history
  • Loading branch information
belovdv committed Apr 21, 2023
1 parent b14356d commit 49426b3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#![allow(dead_code)]

#[cfg(unix)]
pub type RawFd = std::os::fd::RawFd;
type RawFd = std::os::fd::RawFd;
#[cfg(not(unix))]
pub type RawFd = std::convert::Infallible;
type RawFd = std::convert::Infallible;

/// Error type for `from_env_ext` function.
#[derive(Debug)]
Expand Down Expand Up @@ -68,8 +66,9 @@ impl std::error::Error for FromEnvError {
}
}

#[allow(dead_code)]
#[derive(Debug)]
pub enum FromEnvErrorInner {
pub(crate) enum FromEnvErrorInner {
NoEnvVar,
CannotParse(String),
CannotOpenPath(String, std::io::Error),
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl Client {
///
/// # Return value
///
/// `FromEnv` contains result and relevant `var_name` with `var_value`.
/// `FromEnv` contains result and relevant environment variable.
/// If a jobserver was found in the environment and it looks correct then
/// result with the connected client will be returned. In other cases
/// result will contain `Err(FromEnvErr)`.
Expand Down
2 changes: 1 addition & 1 deletion src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Client {
Ok(Client::from_fds(pipes[0], pipes[1]))
}

pub unsafe fn open(s: &str, check_pipe: bool) -> Result<Client, FromEnvErrorInner> {
pub(crate) unsafe fn open(s: &str, check_pipe: bool) -> Result<Client, FromEnvErrorInner> {
if let Some(client) = Self::from_fifo(s)? {
return Ok(client);
}
Expand Down
2 changes: 1 addition & 1 deletion src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl Client {
})
}

pub unsafe fn open(_s: &str, _check_pipe: bool) -> Result<Client, FromEnvErrorInner> {
pub(crate) unsafe fn open(_s: &str, _check_pipe: bool) -> Result<Client, FromEnvErrorInner> {
Err(FromEnvErrorInner::Unsupported)
}

Expand Down
2 changes: 1 addition & 1 deletion src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl Client {
))
}

pub unsafe fn open(s: &str, _check_pipe: bool) -> Result<Client, FromEnvErrorInner> {
pub(crate) unsafe fn open(s: &str, _check_pipe: bool) -> Result<Client, FromEnvErrorInner> {
let name = match CString::new(s) {
Ok(s) => s,
Err(e) => return Err(FromEnvErrorInner::CannotParse(e.to_string())),
Expand Down

0 comments on commit 49426b3

Please sign in to comment.