Skip to content

Commit

Permalink
publics made pub(crate)
Browse files Browse the repository at this point in the history
and the i32 of notification type cast also converted to i8
  • Loading branch information
ysekka committed Jun 21, 2023
1 parent e58d4ec commit 62f996e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl Address {
}
}

/// This pub function is used to write a value to a socket and to get the response
/// This pub(crate) function is used to write a value to a socket and to get the response
pub(crate) async fn write_to_socket(
path: String,
content: CommandContent,
Expand All @@ -215,7 +215,7 @@ pub(crate) async fn write_to_socket(
Ok(String::from_utf8(response)?)
}

/// This pub function is used to write a value to a socket and to get the response
/// This pub(crate) function is used to write a value to a socket and to get the response
pub(crate) fn write_to_socket_sync(path: String, content: CommandContent) -> crate::Result<String> {
use io::prelude::*;
use std::os::unix::net::UnixStream;
Expand All @@ -239,14 +239,14 @@ pub(crate) fn write_to_socket_sync(path: String, content: CommandContent) -> cra
Ok(String::from_utf8(response)?)
}

/// This pub enum holds the different sockets that Hyprland has
/// This pub(crate) enum holds the different sockets that Hyprland has
pub(crate) enum SocketType {
/// The socket used to send commands to Hyprland (AKA `.socket.sock`)
Command,
/// The socket used to listen for events (AKA `.socket2.sock`)
Listener,
}
/// This pub function gets the Hyprland socket path
/// This pub(crate) function gets the Hyprland socket path
pub(crate) fn get_socket_path(socket_type: SocketType) -> String {
let hypr_instance_sig = match var("HYPRLAND_INSTANCE_SIGNATURE") {
Ok(var) => var,
Expand All @@ -262,7 +262,7 @@ pub(crate) fn get_socket_path(socket_type: SocketType) -> String {
format!("/tmp/hypr/{hypr_instance_sig}/{socket_name}")
}

pub fn object_empty_as_none<'de, D, T>(deserializer: D) -> Result<Option<T>, D::Error>
pub(crate) fn object_empty_as_none<'de, D, T>(deserializer: D) -> Result<Option<T>, D::Error>
where
D: Deserializer<'de>,
for<'a> T: Deserialize<'a>,
Expand Down

0 comments on commit 62f996e

Please sign in to comment.