fixrs 0.1.0

Blazing-fast CLI to replace Rust qualified paths with use statements, auto-fixing clippy::absolute_paths
Documentation
use proc_macro2::Span;

/// 记录一处需要被简化的路径信息
#[derive(Debug, Clone)]
pub struct QualifiedPath {
  /// 原始路径完整字符串(如 "wbase::time::now_secs" 或 "std::io::Error")
  pub original: String,
  /// 替换后的短路径文本(如 "now_secs" 或 "Error")
  pub replacement: String,
  /// 应当在文件头部引入的 use 路径(如 "wbase::time::now_secs" 或 "std::io::Error")
  pub import: String,
  /// 原始路径各段名称列表
  pub segments: Vec<String>,
  /// AST span
  pub span: Span,
}

impl QualifiedPath {
  /// 获取路径末尾的符号标识符(零额外堆分配)
  #[inline]
  pub fn last_ident(&self) -> &str {
    self.segments.last().map_or("", String::as_str)
  }
}