rs

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DepKey

func DepKey(crate string) string

DepKey returns the crate name for a Rust import path.

"serde"          -> "serde"
"serde::Deserialize" already gets parsed down to "serde" upstream
"crate::foo"     -> ""    (own crate)
"super::foo"     -> ""    (relative)
"self::foo"      -> ""    (relative)
"std::io"        -> ""    (stdlib)
"core::mem"      -> ""    (stdlib)
"alloc::vec"     -> ""    (stdlib)

Cargo crate names use dashes; Rust import paths use underscores (cargo's --bin auto-renames). depusage stores the underscored form it sees in source. Consumers that want to compare against Cargo.toml dep names can s/_/-/g.

func IsRelative

func IsRelative(crate string) bool

IsRelative reports whether the leading-path-segment refers to project-local code rather than an external crate.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL