1- use crossbeam_channel:: { unbounded, TryRecvError } ;
21use nom:: {
32 branch:: alt,
43 bytes:: complete:: { tag, take_while, take_while_m_n} ,
@@ -13,7 +12,12 @@ use nom::{
1312 AsChar , Err , IResult , InputTakeAtPosition ,
1413} ;
1514use notify:: { event:: ModifyKind , EventKind , RecommendedWatcher , RecursiveMode , Watcher } ;
16- use std:: { collections:: BTreeMap , num:: ParseIntError , path:: Path } ;
15+ use std:: {
16+ collections:: BTreeMap ,
17+ num:: ParseIntError ,
18+ path:: Path ,
19+ sync:: mpsc:: { channel, Receiver , TryRecvError } ,
20+ } ;
1721
1822/// Tries to parse an entire stylesheet.
1923pub fn try_parse_styles ( style : & str ) -> Option < Vec < Rule > > {
@@ -35,7 +39,7 @@ pub struct RulesCache {
3539 buffer : String ,
3640 file_path : String ,
3741 pub rules : Vec < Rule > ,
38- rx : crossbeam_channel :: Receiver < std:: result:: Result < notify:: event:: Event , notify:: Error > > ,
42+ rx : Receiver < std:: result:: Result < notify:: event:: Event , notify:: Error > > ,
3943 _watcher : RecommendedWatcher ,
4044}
4145
@@ -47,7 +51,7 @@ impl RulesCache {
4751 let buffer: String = std:: fs:: read_to_string ( std:: path:: Path :: new ( & file_path) )
4852 . expect ( "Something went wrong reading the file" ) ;
4953
50- let ( tx, rx) = unbounded ( ) ;
54+ let ( tx, rx) = channel ( ) ;
5155 let mut _watcher: RecommendedWatcher =
5256 match notify:: recommended_watcher ( move |res| tx. send ( res) . unwrap ( ) ) {
5357 Ok ( watcher) => watcher,
0 commit comments