From 765c38e7b9adf7151d7aeef2c176bf190073b18f Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 22 Jun 2018 11:47:33 +0600 Subject: [PATCH] remove libc dependency --- Cargo.toml | 1 - src/lib.rs | 1 - src/middleware/logger.rs | 6 ------ 3 files changed, 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f4ca9262d..787ade1e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,7 +60,6 @@ h2 = "0.1" fnv = "1.0.5" http = "^0.1.5" httparse = "1.2" -libc = "0.2" log = "0.4" mime = "0.3" mime_guess = "2.0.0-alpha" diff --git a/src/lib.rs b/src/lib.rs index 90b743810..7cb2b9086 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -107,7 +107,6 @@ extern crate futures_cpupool; extern crate http as modhttp; extern crate httparse; extern crate language_tags; -extern crate libc; extern crate mime; extern crate mime_guess; extern crate mio; diff --git a/src/middleware/logger.rs b/src/middleware/logger.rs index a731d6955..c5701ef8f 100644 --- a/src/middleware/logger.rs +++ b/src/middleware/logger.rs @@ -3,7 +3,6 @@ use std::collections::HashSet; use std::env; use std::fmt::{self, Display, Formatter}; -use libc; use regex::Regex; use time; @@ -53,8 +52,6 @@ use middleware::{Finished, Middleware, Started}; /// /// `%t` Time when the request was started to process /// -/// `%P` The process ID of the child that serviced the request -/// /// `%r` First line of request /// /// `%s` Response status code @@ -181,7 +178,6 @@ impl Format { "%" => FormatText::Percent, "a" => FormatText::RemoteAddr, "t" => FormatText::RequestTime, - "P" => FormatText::Pid, "r" => FormatText::RequestLine, "s" => FormatText::ResponseStatus, "b" => FormatText::ResponseSize, @@ -205,7 +201,6 @@ impl Format { #[derive(Debug, Clone)] pub enum FormatText { Str(String), - Pid, Percent, RequestLine, RequestTime, @@ -247,7 +242,6 @@ impl FormatText { } FormatText::ResponseStatus => resp.status().as_u16().fmt(fmt), FormatText::ResponseSize => resp.response_size().fmt(fmt), - FormatText::Pid => unsafe { libc::getpid().fmt(fmt) }, FormatText::Time => { let rt = time::now() - entry_time; let rt = (rt.num_nanoseconds().unwrap_or(0) as f64) / 1_000_000_000.0;