Skip to main content

get_relative_request_to

Function get_relative_request_to 

Source
pub fn get_relative_request_to<'a>(from: &str, target: &'a str) -> Cow<'a, str>
Expand description

Returns the path of target relative to from, as an explicitly relative module request: "./c", "../c", or "." when the two are equal.

The ./ prefix is what makes the result a relative request: without it, "c" resolves as the package c instead of the file c next to from. Use get_relative_path_to when a plain path is wanted instead.

Returns "." by reference when the paths are identical.