Skip to content

Commit aa205ce

Browse files
committed
remove unneeded lifetimes
1 parent 1fcbbd9 commit aa205ce

10 files changed

+29
-33
lines changed

gtk/src/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub enum UiError {
2222
}
2323

2424
impl UiError {
25-
pub fn iter_sources(&self) -> ErrorIter<'_> { ErrorIter { current: self.source() } }
25+
pub fn iter_sources(&self) -> ErrorIter { ErrorIter { current: self.source() } }
2626
}
2727

2828
#[derive(Debug, Error)]

src/cli.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl Client {
4545
pub fn new() -> Result<Self, client::Error> { client::Client::new().map(Client) }
4646

4747
/// Executes the recovery subcommand of the client.
48-
pub fn recovery(&self, matches: &ArgMatches<'_>) -> Result<(), client::Error> {
48+
pub fn recovery(&self, matches: &ArgMatches) -> Result<(), client::Error> {
4949
match matches.subcommand() {
5050
("upgrade", Some(matches)) => {
5151
match matches.subcommand() {
@@ -76,7 +76,7 @@ impl Client {
7676
Ok(())
7777
}
7878

79-
pub fn release(&self, matches: &ArgMatches<'_>) -> Result<(), client::Error> {
79+
pub fn release(&self, matches: &ArgMatches) -> Result<(), client::Error> {
8080
match matches.subcommand() {
8181
("dismiss", _) => {
8282
let devel = pop_upgrade::development_releases_enabled();
@@ -189,7 +189,7 @@ impl Client {
189189
Ok(())
190190
}
191191

192-
pub fn status(&self, _matches: &ArgMatches<'_>) -> Result<(), client::Error> {
192+
pub fn status(&self, _matches: &ArgMatches) -> Result<(), client::Error> {
193193
let info = self.0.status()?;
194194

195195
let (status, sub_status) = match DaemonStatus::from_u8(info.status) {

src/daemon.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub struct Daemon {
101101
}
102102

103103
impl Daemon {
104-
pub fn new(_factory: &DbusFactory<'_>) -> Result<Self, DaemonError> {
104+
pub fn new(_factory: &DbusFactory) -> Result<Self, DaemonError> {
105105
let connection = Arc::new(
106106
Connection::get_private(BusType::System).map_err(DaemonError::PrivateConnection)?,
107107
);

src/daemon/error.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use dbus;
21
use std::io;
32
use thiserror::Error;
43

src/daemon/methods.rs

+18-21
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use super::result_signal;
1818
// Methods supported by the daemon.
1919
pub const CANCEL: &str = "Cancel";
2020

21-
pub fn cancel(daemon: Rc<RefCell<Daemon>>, dbus_factory: &DbusFactory<'_>) -> Method<MTFn<()>, ()> {
21+
pub fn cancel(daemon: Rc<RefCell<Daemon>>, dbus_factory: &DbusFactory) -> Method<MTFn<()>, ()> {
2222
let method = dbus_factory.method::<_, String>(CANCEL, move |_| {
2323
daemon.borrow_mut().cancel();
2424
Ok(Vec::new())
@@ -39,7 +39,7 @@ pub enum DismissEvent {
3939

4040
pub fn dismiss_notification(
4141
daemon: Rc<RefCell<Daemon>>,
42-
dbus_factory: &DbusFactory<'_>,
42+
dbus_factory: &DbusFactory,
4343
) -> Method<MTFn<()>, ()> {
4444
dbus_factory
4545
.method::<_, String>(DISMISS_NOTIFICATION, move |message| {
@@ -60,7 +60,7 @@ pub const FETCH_UPDATES: &str = "FetchUpdates";
6060

6161
pub fn fetch_updates(
6262
daemon: Rc<RefCell<Daemon>>,
63-
dbus_factory: &DbusFactory<'_>,
63+
dbus_factory: &DbusFactory,
6464
) -> Method<MTFn<()>, ()> {
6565
let method = dbus_factory.method(FETCH_UPDATES, move |message| {
6666
let mut daemon = daemon.borrow_mut();
@@ -94,7 +94,7 @@ pub const FETCH_UPDATES_STATUS: &str = "FetchUpdatesStatus";
9494

9595
pub fn fetch_updates_status(
9696
daemon: Rc<RefCell<Daemon>>,
97-
dbus_factory: &DbusFactory<'_>,
97+
dbus_factory: &DbusFactory,
9898
) -> Method<MTFn<()>, ()> {
9999
let method = dbus_factory.method::<_, u8>(FETCH_UPDATES_STATUS, move |_| {
100100
let (status, why) = result_signal(daemon.borrow().last_known.fetch.as_ref());
@@ -108,7 +108,7 @@ pub const PACKAGE_UPGRADE: &str = "UpgradePackages";
108108

109109
pub fn package_upgrade(
110110
daemon: Rc<RefCell<Daemon>>,
111-
dbus_factory: &DbusFactory<'_>,
111+
dbus_factory: &DbusFactory,
112112
) -> Method<MTFn<()>, ()> {
113113
let method = dbus_factory.method::<_, String>(PACKAGE_UPGRADE, move |_| {
114114
daemon.borrow_mut().set_status(DaemonStatus::PackageUpgrade, move |daemon, active| {
@@ -127,7 +127,7 @@ pub const RECOVERY_UPGRADE_FILE: &str = "RecoveryUpgradeFile";
127127

128128
pub fn recovery_upgrade_file(
129129
daemon: Rc<RefCell<Daemon>>,
130-
dbus_factory: &DbusFactory<'_>,
130+
dbus_factory: &DbusFactory,
131131
) -> Method<MTFn<()>, ()> {
132132
let method = dbus_factory.method::<_, String>(RECOVERY_UPGRADE_FILE, move |message| {
133133
let mut daemon = daemon.borrow_mut();
@@ -148,7 +148,7 @@ pub const RECOVERY_UPGRADE_RELEASE: &str = "RecoveryUpgradeRelease";
148148

149149
pub fn recovery_upgrade_release(
150150
daemon: Rc<RefCell<Daemon>>,
151-
dbus_factory: &DbusFactory<'_>,
151+
dbus_factory: &DbusFactory,
152152
) -> Method<MTFn<()>, ()> {
153153
let method = dbus_factory.method::<_, String>(RECOVERY_UPGRADE_RELEASE, move |message| {
154154
let mut daemon = daemon.borrow_mut();
@@ -177,7 +177,7 @@ pub const RECOVERY_UPGRADE_RELEASE_STATUS: &str = "RecoveryUpgradeReleaseStatus"
177177

178178
pub fn recovery_upgrade_status(
179179
daemon: Rc<RefCell<Daemon>>,
180-
dbus_factory: &DbusFactory<'_>,
180+
dbus_factory: &DbusFactory,
181181
) -> Method<MTFn<()>, ()> {
182182
let method = dbus_factory.method::<_, u8>(RECOVERY_UPGRADE_RELEASE_STATUS, move |_| {
183183
let (status, why) = result_signal(daemon.borrow().last_known.recovery_upgrade.as_ref());
@@ -191,7 +191,7 @@ pub const RECOVERY_VERSION: &str = "RecoveryVersion";
191191

192192
pub fn recovery_version(
193193
daemon: Rc<RefCell<Daemon>>,
194-
dbus_factory: &DbusFactory<'_>,
194+
dbus_factory: &DbusFactory,
195195
) -> Method<MTFn<()>, ()> {
196196
let method = dbus_factory.method(RECOVERY_VERSION, move |_message| {
197197
daemon
@@ -205,10 +205,7 @@ pub fn recovery_version(
205205

206206
pub const REFRESH_OS: &str = "RefreshOS";
207207

208-
pub fn refresh_os(
209-
daemon: Rc<RefCell<Daemon>>,
210-
dbus_factory: &DbusFactory<'_>,
211-
) -> Method<MTFn<()>, ()> {
208+
pub fn refresh_os(daemon: Rc<RefCell<Daemon>>, dbus_factory: &DbusFactory) -> Method<MTFn<()>, ()> {
212209
let method = dbus_factory.method::<_, String>(REFRESH_OS, move |message| {
213210
let enable = message.read1().map_err(|ref why| format_error(why))?;
214211
let value = daemon.borrow_mut().refresh_os(match enable {
@@ -229,7 +226,7 @@ pub const RELEASE_CHECK: &str = "ReleaseCheck";
229226

230227
pub fn release_check(
231228
daemon: Rc<RefCell<Daemon>>,
232-
dbus_factory: &DbusFactory<'_>,
229+
dbus_factory: &DbusFactory,
233230
) -> Method<MTFn<()>, ()> {
234231
let method = dbus_factory.method(RELEASE_CHECK, move |message| {
235232
let development = message.read1().map_err(|ref why| format_error(why))?;
@@ -256,7 +253,7 @@ pub const RELEASE_UPGRADE: &str = "ReleaseUpgrade";
256253

257254
pub fn release_upgrade(
258255
daemon: Rc<RefCell<Daemon>>,
259-
dbus_factory: &DbusFactory<'_>,
256+
dbus_factory: &DbusFactory,
260257
) -> Method<MTFn<()>, ()> {
261258
let method = dbus_factory.method::<_, String>(RELEASE_UPGRADE, move |message| {
262259
let mut daemon = daemon.borrow_mut();
@@ -279,7 +276,7 @@ pub const RELEASE_UPGRADE_FINALIZE: &str = "ReleaseUpgradeFinalize";
279276

280277
pub fn release_upgrade_finalize(
281278
daemon: Rc<RefCell<Daemon>>,
282-
dbus_factory: &DbusFactory<'_>,
279+
dbus_factory: &DbusFactory,
283280
) -> Method<MTFn<()>, ()> {
284281
let method = dbus_factory.method::<_, String>(RELEASE_UPGRADE_FINALIZE, move |_| {
285282
daemon.borrow_mut().release_upgrade_finalize()?;
@@ -293,7 +290,7 @@ pub const RELEASE_UPGRADE_STATUS: &str = "ReleaseUpgradeStatus";
293290

294291
pub fn release_upgrade_status(
295292
daemon: Rc<RefCell<Daemon>>,
296-
dbus_factory: &DbusFactory<'_>,
293+
dbus_factory: &DbusFactory,
297294
) -> Method<MTFn<()>, ()> {
298295
let method = dbus_factory.method::<_, u8>(RELEASE_UPGRADE_STATUS, move |_| {
299296
let (status, why) = result_signal(daemon.borrow().last_known.release_upgrade.as_ref());
@@ -307,7 +304,7 @@ pub const RELEASE_REPAIR: &str = "ReleaseRepair";
307304

308305
pub fn release_repair(
309306
daemon: Rc<RefCell<Daemon>>,
310-
dbus_factory: &DbusFactory<'_>,
307+
dbus_factory: &DbusFactory,
311308
) -> Method<MTFn<()>, ()> {
312309
let method = dbus_factory.method::<_, String>(RELEASE_REPAIR, move |_message| {
313310
let mut daemon = daemon.borrow_mut();
@@ -321,7 +318,7 @@ pub fn release_repair(
321318

322319
pub const RESET: &str = "Reset";
323320

324-
pub fn reset(daemon: Rc<RefCell<Daemon>>, dbus_factory: &DbusFactory<'_>) -> Method<MTFn<()>, ()> {
321+
pub fn reset(daemon: Rc<RefCell<Daemon>>, dbus_factory: &DbusFactory) -> Method<MTFn<()>, ()> {
325322
let method = dbus_factory.method::<_, String>(RESET, move |_| {
326323
async_io::block_on(daemon.borrow_mut().reset())?;
327324
Ok(Vec::new())
@@ -332,7 +329,7 @@ pub fn reset(daemon: Rc<RefCell<Daemon>>, dbus_factory: &DbusFactory<'_>) -> Met
332329

333330
pub const STATUS: &str = "Status";
334331

335-
pub fn status(daemon: Rc<RefCell<Daemon>>, dbus_factory: &DbusFactory<'_>) -> Method<MTFn<()>, ()> {
332+
pub fn status(daemon: Rc<RefCell<Daemon>>, dbus_factory: &DbusFactory) -> Method<MTFn<()>, ()> {
336333
let method = dbus_factory.method::<_, String>(STATUS, move |_| {
337334
let daemon = daemon.borrow_mut();
338335
let status = daemon.status.load(Ordering::SeqCst) as u8;
@@ -348,7 +345,7 @@ pub const UPDATE_CHECK: &str = "UpdateCheck";
348345

349346
pub fn update_check(
350347
daemon: Rc<RefCell<Daemon>>,
351-
dbus_factory: &DbusFactory<'_>,
348+
dbus_factory: &DbusFactory,
352349
) -> Method<MTFn<()>, ()> {
353350
let method = dbus_factory.method::<_, String>(UPDATE_CHECK, move |_| {
354351
let status = async_io::block_on(daemon.borrow_mut().update_and_restart());

src/daemon/signals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub enum SignalEvent {
3737
}
3838

3939
impl Display for SignalEvent {
40-
fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
40+
fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
4141
use self::SignalEvent::*;
4242
match self {
4343
FetchResult(result) => write!(fmt, "fetch result: {:?}", result),

src/daemon/status.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl From<DaemonStatus> for &'static str {
2424
}
2525

2626
impl Display for DaemonStatus {
27-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
27+
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
2828
fmt.write_str(<&'static str>::from(*self))
2929
}
3030
}

src/logging.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::io;
44
use yansi::Paint;
55

66
pub fn setup_logging(filter: LevelFilter) -> Result<(), InitError> {
7-
let location = |record: &Record<'_>| {
7+
let location = |record: &Record| {
88
let mut target = record.target();
99
if let Some(pos) = target.find(':') {
1010
target = &target[..pos];
@@ -22,7 +22,7 @@ pub fn setup_logging(filter: LevelFilter) -> Result<(), InitError> {
2222
}
2323
};
2424

25-
let format_level = |record: &Record<'_>| match record.level() {
25+
let format_level = |record: &Record| match record.level() {
2626
level @ Level::Trace => Paint::green(level).bold(),
2727
level @ Level::Warn => Paint::yellow(level).bold(),
2828
level @ Level::Error => Paint::red(level).bold(),

src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ pub fn main() {
174174
}
175175
}
176176

177-
fn main_(matches: &ArgMatches<'_>) -> Result<(), Error> {
177+
fn main_(matches: &ArgMatches) -> Result<(), Error> {
178178
init()?;
179179

180180
match matches.subcommand() {

src/sighandler.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn status() -> Option<Signal> {
2424
}
2525

2626
impl Display for Signal {
27-
fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
27+
fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
2828
let string = match *self {
2929
Signal::Interrupt => "interrupt",
3030
Signal::Hangup => "hangup",

0 commit comments

Comments
 (0)