/// Handles errors where other Cargo processes are also attempting to
/// concurrently create this directory.
pub fn create_dir(&self) -> io::Result<()> {
- create_dir_all(&self.root)
+ fs::create_dir_all(&self.root)
}
/// Returns an adaptor that can be used to print the path of this
let f = opts.open(&path)
.or_else(|e| {
if e.kind() == io::ErrorKind::NotFound && state == State::Exclusive {
- create_dir_all(path.parent().unwrap())?;
+ fs::create_dir_all(path.parent().unwrap())?;
opts.open(&path)
} else {
Err(e)
false
}
}
-
-fn create_dir_all(path: &Path) -> io::Result<()> {
- match create_dir(path) {
- Ok(()) => Ok(()),
- Err(e) => {
- if e.kind() == io::ErrorKind::NotFound {
- if let Some(p) = path.parent() {
- return create_dir_all(p).and_then(|()| create_dir(path));
- }
- }
- Err(e)
- }
- }
-}
-
-fn create_dir(path: &Path) -> io::Result<()> {
- match fs::create_dir(path) {
- Ok(()) => Ok(()),
- Err(ref e) if e.kind() == io::ErrorKind::AlreadyExists => Ok(()),
- Err(e) => Err(e),
- }
-}
use core::{GitReference, PackageIdSpec, Profiles, SourceId, WorkspaceConfig, WorkspaceRootConfig};
use core::{Dependency, Manifest, PackageId, Summary, Target};
-use core::{EitherManifest, Edition, Feature, Features, VirtualManifest};
+use core::{Edition, EitherManifest, Feature, Features, VirtualManifest};
use core::dependency::{Kind, Platform};
use core::manifest::{LibKind, Lto, ManifestMetadata, Profile};
use sources::CRATES_IO;