@@ -8,7 +8,7 @@ use nix::sys::eventfd;
88use std:: fs:: { self , File } ;
99use std:: io:: Read ;
1010use std:: os:: unix:: io:: { AsRawFd , FromRawFd } ;
11- use std:: path:: { Path , PathBuf } ;
11+ use std:: path:: Path ;
1212use std:: sync:: mpsc:: { self , Receiver } ;
1313use std:: thread;
1414
@@ -17,18 +17,18 @@ use crate::error::*;
1717
1818// notify_on_oom returns channel on which you can expect event about OOM,
1919// if process died without OOM this channel will be closed.
20- pub fn notify_on_oom_v2 ( key : & str , dir : & PathBuf ) -> Result < Receiver < String > > {
20+ pub fn notify_on_oom_v2 ( key : & str , dir : & Path ) -> Result < Receiver < String > > {
2121 register_memory_event ( key, dir, "memory.oom_control" , "" )
2222}
2323
2424// notify_on_oom returns channel on which you can expect event about OOM,
2525// if process died without OOM this channel will be closed.
26- pub fn notify_on_oom_v1 ( key : & str , dir : & PathBuf ) -> Result < Receiver < String > > {
26+ pub fn notify_on_oom_v1 ( key : & str , dir : & Path ) -> Result < Receiver < String > > {
2727 register_memory_event ( key, dir, "memory.oom_control" , "" )
2828}
2929
3030// level is one of "low", "medium", or "critical"
31- pub fn notify_memory_pressure ( key : & str , dir : & PathBuf , level : & str ) -> Result < Receiver < String > > {
31+ pub fn notify_memory_pressure ( key : & str , dir : & Path , level : & str ) -> Result < Receiver < String > > {
3232 if level != "low" && level != "medium" && level != "critical" {
3333 return Err ( Error :: from_string ( format ! (
3434 "invalid pressure level {}" ,
@@ -41,7 +41,7 @@ pub fn notify_memory_pressure(key: &str, dir: &PathBuf, level: &str) -> Result<R
4141
4242fn register_memory_event (
4343 key : & str ,
44- cg_dir : & PathBuf ,
44+ cg_dir : & Path ,
4545 event_name : & str ,
4646 arg : & str ,
4747) -> Result < Receiver < String > > {
0 commit comments