Function re_log::shorten_file_path

source ·
pub(crate) fn shorten_file_path(file_path: &str) -> &str
Expand description

Shorten a path to a Rust source file.

Example input:

  • /Users/emilk/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.24.1/src/runtime/runtime.rs
  • crates/rerun/src/main.rs
  • /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ops/function.rs

Example output:

  • tokio-1.24.1/src/runtime/runtime.rs
  • rerun/src/main.rs
  • core/src/ops/function.rs