@@ -34,13 +34,19 @@ pub struct Conflict<'a> {
34
34
35
35
impl < ' a > fmt:: Debug for Conflict < ' a > {
36
36
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
37
- f. debug_struct ( "Conflict" )
38
- . field ( "package1" , & self . package1 ( ) )
39
- . field ( "package1_hash" , & self . package1_hash ( ) )
40
- . field ( "package2" , & self . package2 ( ) )
41
- . field ( "package2_hash" , & self . package2_hash ( ) )
42
- . field ( "reason" , & self . reason ( ) )
43
- . finish ( )
37
+ #[ cfg( not( feature = "git" ) ) ]
38
+ {
39
+ f. debug_struct ( "Conflict" )
40
+ . field ( "package1" , & self . package1 ( ) )
41
+ . field ( "package2" , & self . package2 ( ) )
42
+ . field ( "reason" , & self . reason ( ) )
43
+ . finish ( )
44
+ }
45
+ // Implement properly when we merge the no handle code
46
+ #[ cfg( feature = "git" ) ]
47
+ {
48
+ f. debug_struct ( "Conflict" ) . finish ( )
49
+ }
44
50
}
45
51
}
46
52
@@ -70,28 +76,42 @@ impl<'a> Conflict<'a> {
70
76
self . inner . as_ptr ( )
71
77
}
72
78
79
+ #[ cfg( not( feature = "git" ) ) ]
73
80
pub fn package1_hash ( & self ) -> u64 {
74
81
#[ allow( clippy:: useless_conversion) ]
75
82
unsafe {
76
83
( * self . as_ptr ( ) ) . package1_hash . into ( )
77
84
}
78
85
}
79
86
87
+ #[ cfg( not( feature = "git" ) ) ]
80
88
pub fn package2_hash ( & self ) -> u64 {
81
89
#[ allow( clippy:: useless_conversion) ]
82
90
unsafe {
83
91
( * self . as_ptr ( ) ) . package2_hash . into ( )
84
92
}
85
93
}
86
94
95
+ #[ cfg( not( feature = "git" ) ) ]
87
96
pub fn package1 ( & self ) -> & ' a str {
88
97
unsafe { from_cstr ( ( * self . as_ptr ( ) ) . package1 ) }
89
98
}
90
99
100
+ #[ cfg( not( feature = "git" ) ) ]
91
101
pub fn package2 ( & self ) -> & ' a str {
92
102
unsafe { from_cstr ( ( * self . as_ptr ( ) ) . package2 ) }
93
103
}
94
104
105
+ #[ cfg( feature = "git" ) ]
106
+ pub fn package1 ( & self ) -> & ' a str {
107
+ unsafe { from_cstr ( alpm_pkg_get_name ( ( * self . as_ptr ( ) ) . package1 ) ) }
108
+ }
109
+
110
+ #[ cfg( feature = "git" ) ]
111
+ pub fn package2 ( & self ) -> & ' a str {
112
+ unsafe { from_cstr ( alpm_pkg_get_name ( ( * self . as_ptr ( ) ) . package2 ) ) }
113
+ }
114
+
95
115
pub fn reason ( & self ) -> Dep < ' a > {
96
116
unsafe { Dep :: from_ptr ( ( * self . as_ptr ( ) ) . reason ) }
97
117
}
0 commit comments