Skip to content

Commit 548499d

Browse files
Koenraad VerheydenJoshua Nelson
authored andcommitted
CrateDetails: access Vec directly
1 parent d3dcf10 commit 548499d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/web/crate_details.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ impl CrateDetails {
262262

263263
/// Returns the version of the latest release of this crate.
264264
pub fn latest_version(&self) -> &str {
265-
// this is safe to unwrap: releases will always contain at least the version of this release
266-
&self.releases.get(0).unwrap().version
265+
// releases will always contain at least one element
266+
&self.releases[0].version
267267
}
268268
}
269269

0 commit comments

Comments
 (0)