Skip to content

Commit 2f2167c

Browse files
committed
new rustfmt
1 parent 1d2364d commit 2f2167c

File tree

6 files changed

+18
-31
lines changed

6 files changed

+18
-31
lines changed

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn main() {
1010
build.cpp(true);
1111
build.flag("-std=gnu++11");
1212

13-
#[cfg(feature="ye-olde-apt")]
13+
#[cfg(feature = "ye-olde-apt")]
1414
{
1515
build.define("YE_OLDE_APT", "1");
1616
}

examples/policy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
extern crate apt_pkg_native;
22
use std::env;
33

4-
use apt_pkg_native::simple;
54
use apt_pkg_native::Cache;
5+
use apt_pkg_native::simple;
66

77
fn main() {
88
let pkg = env::args()

src/citer.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::ops::Deref;
21
use std::marker::PhantomData;
2+
use std::ops::Deref;
33

44
pub trait RawIterator {
55
type View;
@@ -101,7 +101,6 @@ where
101101
false
102102
}
103103

104-
105104
pub fn all<F>(mut self, mut f: F) -> bool
106105
where
107106
F: FnMut(&R::View) -> bool,

src/raw.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
/// * `*mut c_void` are to be released by the appropriate function
33
/// * `*const c_chars` are short-term borrows
44
/// * `*mut c_chars` are to be freed by `libc::free`.
5-
65
use std::sync::Mutex;
76

8-
use libc::c_void;
97
use libc::c_char;
8+
use libc::c_void;
109

1110
pub type PCache = *mut c_void;
1211
pub type PPkgIterator = *mut c_void;
@@ -43,7 +42,6 @@ extern "C" {
4342
pub fn pkg_iter_next(iterator: PPkgIterator);
4443
pub fn pkg_iter_end(iterator: PPkgIterator) -> bool;
4544

46-
4745
// Package iterator accessors
4846
// ==========================
4947

@@ -52,7 +50,6 @@ extern "C" {
5250
pub fn pkg_iter_current_version(iterator: PPkgIterator) -> *const c_char;
5351
pub fn pkg_iter_candidate_version(iterator: PPkgIterator) -> *const c_char;
5452

55-
5653
// Version iterators
5754
// =================
5855

@@ -68,14 +65,14 @@ extern "C" {
6865
pub fn ver_iter_version(iterator: PVerIterator) -> *mut c_char;
6966
pub fn ver_iter_section(iterator: PVerIterator) -> *mut c_char;
7067

71-
#[cfg(not(feature="ye-olde-apt"))]
68+
#[cfg(not(feature = "ye-olde-apt"))]
7269
pub fn ver_iter_source_package(iterator: PVerIterator) -> *mut c_char;
7370

74-
#[cfg(not(feature="ye-olde-apt"))]
71+
#[cfg(not(feature = "ye-olde-apt"))]
7572
pub fn ver_iter_source_version(iterator: PVerIterator) -> *mut c_char;
7673
pub fn ver_iter_arch(iterator: PVerIterator) -> *mut c_char;
7774

78-
#[cfg(not(feature="ye-olde-apt"))]
75+
#[cfg(not(feature = "ye-olde-apt"))]
7976
pub fn ver_iter_priority(iterator: PVerIterator) -> i32;
8077

8178
pub fn ver_iter_ver_file_iter(iterator: PVerIterator) -> PVerFileIterator;
@@ -84,14 +81,12 @@ extern "C" {
8481
pub fn ver_file_iter_next(iterator: PVerFileIterator);
8582
pub fn ver_file_iter_end(iterator: PVerFileIterator) -> bool;
8683

87-
8884
pub fn ver_file_iter_pkg_file_iter(iterator: PVerFileIterator) -> PPkgFileIterator;
8985
pub fn pkg_file_iter_release(iterator: PPkgFileIterator);
9086

9187
pub fn pkg_file_iter_next(iterator: PPkgFileIterator);
9288
pub fn pkg_file_iter_end(iterator: PPkgFileIterator) -> bool;
9389

94-
9590
pub fn pkg_file_iter_file_name(iterator: PPkgFileIterator) -> *const c_char;
9691
pub fn pkg_file_iter_archive(iterator: PPkgFileIterator) -> *const c_char;
9792
pub fn pkg_file_iter_version(iterator: PPkgFileIterator) -> *const c_char;

src/sane.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ impl<'c> RawIterator for PkgIterator<'c> {
146146
}
147147
}
148148

149-
150149
/// Actual accessors
151150
impl<'c> PkgView<'c> {
152151
pub fn name(&self) -> String {
@@ -238,23 +237,23 @@ impl<'c> VerView<'c> {
238237
unsafe { make_owned_ascii_string(raw::ver_iter_section(self.ptr)) }
239238
}
240239

241-
#[cfg(not(feature="ye-olde-apt"))]
240+
#[cfg(not(feature = "ye-olde-apt"))]
242241
pub fn source_package(&self) -> String {
243242
unsafe {
244243
make_owned_ascii_string(raw::ver_iter_source_package(self.ptr))
245244
.expect("versions always have a source package")
246245
}
247246
}
248247

249-
#[cfg(not(feature="ye-olde-apt"))]
248+
#[cfg(not(feature = "ye-olde-apt"))]
250249
pub fn source_version(&self) -> String {
251250
unsafe {
252251
make_owned_ascii_string(raw::ver_iter_source_version(self.ptr))
253252
.expect("versions always have a source_version")
254253
}
255254
}
256255

257-
#[cfg(not(feature="ye-olde-apt"))]
256+
#[cfg(not(feature = "ye-olde-apt"))]
258257
pub fn priority(&self) -> i32 {
259258
unsafe { raw::ver_iter_priority(self.ptr) }
260259
}
@@ -283,7 +282,6 @@ pub struct VerFileView<'c> {
283282
ptr: raw::PVerFileIterator,
284283
}
285284

286-
287285
impl<'c> RawIterator for VerFileIterator<'c> {
288286
type View = VerFileView<'c>;
289287

@@ -321,7 +319,6 @@ impl<'c> VerFileView<'c> {
321319
}
322320
}
323321

324-
325322
/// An "iterator"/pointer to a point in a file list.
326323
pub struct PkgFileIterator<'c> {
327324
cache: PhantomData<&'c MutexGuard<'c, raw::CacheHolder>>,

src/simple.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,25 @@ pub struct Version {
4242
pub arch: String,
4343
pub section: Option<String>,
4444

45-
#[cfg(not(feature="ye-olde-apt"))]
45+
#[cfg(not(feature = "ye-olde-apt"))]
4646
pub source_package: String,
47-
#[cfg(not(feature="ye-olde-apt"))]
47+
#[cfg(not(feature = "ye-olde-apt"))]
4848
pub source_version: String,
49-
#[cfg(not(feature="ye-olde-apt"))]
49+
#[cfg(not(feature = "ye-olde-apt"))]
5050
pub priority: i32,
5151
}
5252

53-
5453
impl Version {
5554
pub fn new(view: &sane::VerView) -> Self {
5655
Version {
5756
version: view.version(),
5857
arch: view.arch(),
5958
section: view.section(),
60-
#[cfg(not(feature="ye-olde-apt"))]
59+
#[cfg(not(feature = "ye-olde-apt"))]
6160
source_package: view.source_package(),
62-
#[cfg(not(feature="ye-olde-apt"))]
61+
#[cfg(not(feature = "ye-olde-apt"))]
6362
source_version: view.source_version(),
64-
#[cfg(not(feature="ye-olde-apt"))]
63+
#[cfg(not(feature = "ye-olde-apt"))]
6564
priority: view.priority(),
6665
}
6766
}
@@ -73,13 +72,11 @@ impl fmt::Display for Version {
7372
if let Some(ref section) = self.section {
7473
write!(f, " in {}", section)?;
7574
}
76-
#[cfg(not(feature="ye-olde-apt"))]
75+
#[cfg(not(feature = "ye-olde-apt"))]
7776
write!(
7877
f,
7978
" from {}:{} at {}",
80-
self.source_package,
81-
self.source_version,
82-
self.priority,
79+
self.source_package, self.source_version, self.priority,
8380
)?;
8481

8582
Ok(())
@@ -166,7 +163,6 @@ impl VersionOrigins {
166163
}
167164
}
168165

169-
170166
#[derive(Clone, Debug)]
171167
pub struct BinaryPackageVersions {
172168
pub pkg: BinaryPackage,

0 commit comments

Comments
 (0)