rewrite-rustdoc

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Rewrite Rustdoc

重写Rustdoc

Ensure all Rust documentation and comments are exclusively written in English, following rustdoc guidelines.
确保所有Rust文档和注释均完全使用英文编写,遵循rustdoc指南。

Steps

步骤

  1. Determine which files to process:
    • If the user provides a method to find files, use that method.
    • Otherwise, assume files are in the
      src/
      directory.
    • Proceed immediately to the next steps after acquiring file information.
  2. Conduct a comprehensive review to ensure all documentation and comments are in English.
    • Any Chinese text in documentation or code comments must be identified and corrected.
    • Chinese characters in test case strings are permissible and do not require modification.
    • Chinese report files should not be modified — focus on Rust source code files only.
  3. Search for Chinese characters in the source code:
    bash
    rg -n "[\u4e00-\u9fff]" src/
    Check for missing documentation:
    bash
    cd src/ && cargo clippy -- -W missing_docs
    Replace
    src/
    with the user-specified location if provided.
  4. Refer to
    ./docs/rustdoc-guidelines.md
    for documentation structure and style standards.
  5. Ensure all corrections adhere strictly to the documentation guidelines.
  6. Repeat the search and revision process iteratively until no further occurrences require modification.
    • Do not prompt for confirmation before proceeding to the next item.
    • Complete all necessary changes before reporting back.
  1. 确定要处理的文件:
    • 如果用户提供了查找文件的方法,请使用该方法。
    • 否则,默认文件位于
      src/
      目录下。
    • 获取文件信息后立即进入下一步。
  2. 进行全面检查,确保所有文档和注释均为英文。
    • 必须识别并修正文档或代码注释中的任何中文文本。
    • 测试用例字符串中的中文字符是允许的,无需修改。
    • 中文报告文件不应修改——仅关注Rust源代码文件。
  3. 在源代码中搜索中文字符:
    bash
    rg -n "[\u4e00-\u9fff]" src/
    检查缺失的文档:
    bash
    cd src/ && cargo clippy -- -W missing_docs
    如果用户指定了位置,请将
    src/
    替换为用户指定的路径。
  4. 参考
    ./docs/rustdoc-guidelines.md
    获取文档结构和样式标准。
  5. 确保所有修正严格遵循文档指南。
  6. 反复执行搜索和修订流程,直到没有需要修改的内容为止。
    • 在处理下一项之前无需确认。
    • 完成所有必要修改后再反馈结果。