Skip to content

Commit 0822ab5

Browse files
jyn514Joshua Nelson
authored and
Joshua Nelson
committed
Remove deprecation warnings
1 parent 4e98970 commit 0822ab5

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/web/error.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,16 @@ pub enum Nope {
1414

1515
impl fmt::Display for Nope {
1616
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
17-
f.write_str(self.description())
18-
}
19-
}
20-
21-
impl Error for Nope {
22-
fn description(&self) -> &str {
23-
match *self {
17+
f.write_str(match *self {
2418
Nope::ResourceNotFound => "Requested resource not found",
2519
Nope::CrateNotFound => "Requested crate not found",
2620
Nope::NoResults => "Search yielded no results",
27-
}
21+
})
2822
}
2923
}
3024

25+
impl Error for Nope {}
26+
3127
impl Handler for Nope {
3228
fn handle(&self, req: &mut Request) -> IronResult<Response> {
3329
match *self {

src/web/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ mod routes;
4848
pub(crate) mod metrics;
4949

5050
use std::{env, fmt};
51-
use std::error::Error;
5251
use std::time::Duration;
5352
use std::path::PathBuf;
5453
use std::net::SocketAddr;
@@ -98,7 +97,7 @@ impl CratesfyiHandler {
9897

9998
// load templates
10099
if let Err(e) = hbse.reload() {
101-
panic!("Failed to load handlebar templates: {}", e.description());
100+
panic!("Failed to load handlebar templates: {}", e);
102101
}
103102

104103
let mut chain = Chain::new(base);

0 commit comments

Comments
 (0)