Remove libc dependency
The function std::process::id() is available in the "stable" channel now.
This commit is contained in:
parent
6c1b159435
commit
3ebc936b10
|
@ -19,7 +19,6 @@ serde_derive = "^1.0"
|
||||||
serde_json = "^1.0"
|
serde_json = "^1.0"
|
||||||
byteorder = "^1.0"
|
byteorder = "^1.0"
|
||||||
log = "~0.4"
|
log = "~0.4"
|
||||||
libc = "0.2.39" # until std::process::id is stable
|
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
named_pipe = "0.3.0"
|
named_pipe = "0.3.0"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
use serde::{Serialize, de::DeserializeOwned};
|
use serde::{Serialize, de::DeserializeOwned};
|
||||||
|
#[allow(unused)]
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
use connection::Manager as ConnectionManager;
|
use connection::Manager as ConnectionManager;
|
||||||
|
|
|
@ -7,7 +7,6 @@ extern crate serde;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
extern crate byteorder;
|
extern crate byteorder;
|
||||||
extern crate uuid;
|
extern crate uuid;
|
||||||
extern crate libc;
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
extern crate named_pipe;
|
extern crate named_pipe;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ use utils;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Deserialize, Serialize)]
|
#[derive(Debug, PartialEq, Deserialize, Serialize)]
|
||||||
pub struct SetActivityArgs {
|
pub struct SetActivityArgs {
|
||||||
pid: i32,
|
pid: u32,
|
||||||
|
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
activity: Option<Activity>,
|
activity: Option<Activity>,
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use libc::getpid;
|
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
|
|
||||||
pub fn pid() -> i32 {
|
#[allow(unused)]
|
||||||
unsafe { getpid() as i32 }
|
pub fn pid() -> u32 {
|
||||||
|
std::process::id()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn nonce() -> String {
|
pub fn nonce() -> String {
|
||||||
|
|
Loading…
Reference in New Issue