Skip to content

Commit a7a3cdc

Browse files
committed
Remove wrong and unnecessary check for build world
This was changed in 18fecf5 to negate the condition (`!is_dir()` -> `is_dir()`), which is a bug. However, the whole check is unnecessary, `read_dir` already returns an error if the path isn't a directory.
1 parent faab341 commit a7a3cdc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/docbuilder/crates.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::error::Result;
2-
use anyhow::{ensure, Context};
2+
use anyhow::Context;
33
use serde_json::Value;
44
use std::io::prelude::*;
55
use std::io::BufReader;
@@ -62,8 +62,6 @@ pub fn crates_from_path<F>(path: &Path, func: &mut F) -> Result<()>
6262
where
6363
F: FnMut(&str, &str),
6464
{
65-
ensure!(!path.is_dir(), "Not a directory");
66-
6765
for file in path.read_dir()? {
6866
let file = file?;
6967
let path = file.path();

0 commit comments

Comments
 (0)