File tree Expand file tree Collapse file tree 6 files changed +21
-18
lines changed Expand file tree Collapse file tree 6 files changed +21
-18
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ libc = "0.2"
23
23
24
24
[dev-dependencies ]
25
25
boolinator = " 2"
26
- itertools = " 0.7 "
26
+ itertools = " 0.8 "
27
27
28
28
[features ]
29
29
default = []
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ extern crate itertools;
3
3
4
4
use itertools:: Itertools ;
5
5
6
- use apt_pkg_native:: Cache ;
7
6
use apt_pkg_native:: simple;
7
+ use apt_pkg_native:: Cache ;
8
8
9
9
fn main ( ) {
10
10
let mut cache = Cache :: get_singleton ( ) ;
Original file line number Diff line number Diff line change 1
1
extern crate apt_pkg_native;
2
2
use std:: env;
3
3
4
- use apt_pkg_native:: Cache ;
5
4
use apt_pkg_native:: simple;
5
+ use apt_pkg_native:: Cache ;
6
6
7
7
fn main ( ) {
8
8
let pkg = env:: args ( )
@@ -19,7 +19,8 @@ fn main() {
19
19
if let Some ( view) = found. next ( ) {
20
20
println ! ( "{}:{}:" , view. name( ) , view. arch( ) ) ;
21
21
22
- let installed_version = view. current_version ( )
22
+ let installed_version = view
23
+ . current_version ( )
23
24
. unwrap_or_else ( || "(none)" . to_string ( ) ) ;
24
25
println ! ( " Installed: {}" , installed_version) ;
25
26
println ! (
Original file line number Diff line number Diff line change @@ -171,9 +171,11 @@ where
171
171
fn next ( & mut self ) -> Option < Self :: Item > {
172
172
loop {
173
173
match self . it . next ( ) {
174
- Some ( ref x) => if let Some ( y) = ( self . f ) ( x) {
175
- return Some ( y) ;
176
- } ,
174
+ Some ( ref x) => {
175
+ if let Some ( y) = ( self . f ) ( x) {
176
+ return Some ( y) ;
177
+ }
178
+ }
177
179
None => return None ,
178
180
}
179
181
}
Original file line number Diff line number Diff line change @@ -64,14 +64,10 @@ mod tests {
64
64
panic ! ( "not found!" ) ;
65
65
}
66
66
67
- assert ! (
68
- cache
69
- . find_by_name(
70
- "this-package-doesnt-exist-and-if-someone-makes-it-ill-be-really-angry"
71
- )
72
- . next( )
73
- . is_none( )
74
- ) ;
67
+ assert ! ( cache
68
+ . find_by_name( "this-package-doesnt-exist-and-if-someone-makes-it-ill-be-really-angry" )
69
+ . next( )
70
+ . is_none( ) ) ;
75
71
}
76
72
77
73
#[ test]
Original file line number Diff line number Diff line change @@ -122,8 +122,11 @@ impl Origin {
122
122
impl fmt:: Display for Origin {
123
123
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
124
124
// trying to simulate apt-cache policy, but a lot of information is missing
125
- if self . site . is_some ( ) && self . origin . is_some ( ) && self . label . is_some ( )
126
- && self . codename . is_some ( ) && self . architecture . is_some ( )
125
+ if self . site . is_some ( )
126
+ && self . origin . is_some ( )
127
+ && self . label . is_some ( )
128
+ && self . codename . is_some ( )
129
+ && self . architecture . is_some ( )
127
130
{
128
131
write ! (
129
132
f,
@@ -153,7 +156,8 @@ impl VersionOrigins {
153
156
pub fn new ( view : & sane:: VerView ) -> Self {
154
157
VersionOrigins {
155
158
version : Version :: new ( view) ,
156
- origins : view. origin_iter ( )
159
+ origins : view
160
+ . origin_iter ( )
157
161
. map ( |o| {
158
162
Origin :: from_ver_file ( o)
159
163
. expect ( "a version's origin should always have a backing file" )
You can’t perform that action at this time.
0 commit comments