Skip to content

Commit

Permalink
Fixup nth(0) lint
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Anderson <mark@chef.io>
  • Loading branch information
markan committed Aug 13, 2020
1 parent f55e474 commit ab282c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/builder-graph/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub fn file_into_idents(path: &str) -> Result<Vec<PackageIdent>, error::Error> {
}

fn line_to_ident(line: &str) -> Option<Result<PackageIdent, error::Error>> {
let trimmed = line.split('#').nth(0).unwrap_or("").trim();
let trimmed = line.split('#').next().unwrap_or("").trim();
match trimmed.len() {
0 => None,
_ => Some(PackageIdent::from_str(trimmed).map_err(error::Error::HabitatCore)),
Expand Down
2 changes: 1 addition & 1 deletion components/builder-jobsrv/src/server/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ fn populate_build_projects(msg: &jobsrv::JobGroupSpec,
continue;
};

let origin = s.0.split('/').nth(0).unwrap();
let origin = s.0.split('/').next().unwrap();

// If the origin_only flag is true, make sure the origin matches
if !msg.get_origin_only() || origin == msg.get_origin() {
Expand Down

0 comments on commit ab282c3

Please sign in to comment.