mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
refactor: make local function invisible
This commit is contained in:
parent
392db56a08
commit
b59e827dba
@ -13,6 +13,12 @@ use log::debug;
|
|||||||
|
|
||||||
/// Bacially just normalizes a given path and converts it to a string.
|
/// Bacially just normalizes a given path and converts it to a string.
|
||||||
fn render_filename<P: AsRef<Path>>(path: P, basedir: Option<&str>) -> CargoResult<String> {
|
fn render_filename<P: AsRef<Path>>(path: P, basedir: Option<&str>) -> CargoResult<String> {
|
||||||
|
fn wrap_path(path: &Path) -> CargoResult<String> {
|
||||||
|
path.to_str()
|
||||||
|
.ok_or_else(|| internal(format!("path `{:?}` not utf-8", path)))
|
||||||
|
.map(|f| f.replace(" ", "\\ "))
|
||||||
|
}
|
||||||
|
|
||||||
let path = path.as_ref();
|
let path = path.as_ref();
|
||||||
if let Some(basedir) = basedir {
|
if let Some(basedir) = basedir {
|
||||||
let norm_path = normalize_path(path);
|
let norm_path = normalize_path(path);
|
||||||
@ -26,12 +32,6 @@ fn render_filename<P: AsRef<Path>>(path: P, basedir: Option<&str>) -> CargoResul
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn wrap_path(path: &Path) -> CargoResult<String> {
|
|
||||||
path.to_str()
|
|
||||||
.ok_or_else(|| internal(format!("path `{:?}` not utf-8", path)))
|
|
||||||
.map(|f| f.replace(" ", "\\ "))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Collects all dependencies of the `unit` for the output dep info file.
|
/// Collects all dependencies of the `unit` for the output dep info file.
|
||||||
///
|
///
|
||||||
/// Dependencies will be stored in `deps`, including:
|
/// Dependencies will be stored in `deps`, including:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user