File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -120,19 +120,19 @@ fn main() -> io::Result<()> {
120
120
121
121
// wait for sysfs device to create
122
122
let mut count = 0 ;
123
- let mut sysfs_path = None ;
123
+ let mut dev_path = None ;
124
124
println ! ( "Attempt open device path: {}" , DEV_PATH ) ;
125
125
while count < 5 {
126
126
std:: thread:: sleep ( std:: time:: Duration :: from_secs ( 1 ) ) ;
127
127
// test open access
128
- if let Ok ( _) = OpenOptions :: new ( ) . read ( true ) . write ( true ) . open ( & SYSFS_PATH ) {
129
- sysfs_path = Some ( PathBuf :: from ( SYSFS_PATH ) ) ;
128
+ if let Ok ( _) = OpenOptions :: new ( ) . read ( true ) . write ( true ) . open ( & DEV_PATH ) {
129
+ dev_path = Some ( PathBuf :: from ( DEV_PATH ) ) ;
130
130
break ;
131
131
}
132
132
count += 1 ;
133
133
}
134
134
135
- match sysfs_path {
135
+ match dev_path {
136
136
Some ( pp) => {
137
137
let mut file = OpenOptions :: new ( ) . read ( true ) . write ( true ) . open ( & pp) ?;
138
138
@@ -146,9 +146,8 @@ fn main() -> io::Result<()> {
146
146
Ok ( ( ) )
147
147
}
148
148
}
149
- None => Err ( io:: Error :: new (
150
- io:: ErrorKind :: NotFound ,
151
- format ! ( "Printer {} not found or cannot open" , SYSFS_PATH ) ,
152
- ) ) ,
149
+ _ => {
150
+ Err ( io:: Error :: new ( io:: ErrorKind :: NotFound , format ! ( "Printer {} not found or cannot open" , DEV_PATH ) ) )
151
+ }
153
152
}
154
153
}
You can’t perform that action at this time.
0 commit comments