Skip to content

Commit b33cb4d

Browse files
committed
Updates based on clippy.
1 parent 3350781 commit b33cb4d

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "git2prompt"
33
version = "0.1.0"
44
authors = ["Fabio Thomaz Molinar <[email protected]>"]
55
description = "git2prompt is a command-line tool that takes a GitHub repository URL, downloads its contents, and generates a single text file optimized for use as input to AI tools."
6+
readme = "README.md"
67
license = "Apache-2.0"
78
repository = "https://github.com/fabiomolinar/git2prompt"
89
categories = ["command-line-interface", "parsing"]

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,12 @@ As I am starting my journey with Rust, here it goes a few reminders so I don't h
7878
- To run Rust built-in linters, run `cargo clippy` (run with `--fix` to automatically fix the issues).
7979
- To run the tests with a specific test file, run `cargo test <test-file>`.
8080
- To run the tests with a specific test function, run `cargo test <test-function>`.
81+
82+
Before pushing to *crates.io*, run the following:
83+
84+
1. cargo build
85+
2. cargo test
86+
3. cargo fmt
87+
4. cargo clippy
88+
89+
If all good, `cargo package` and then `cargo publish`.

src/processing.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub async fn process_repository_files(
2828
repo_path: &std::path::Path,
2929
no_headers: bool,
3030
merge_files: bool,
31-
ignore_patterns: &Vec<String>,
31+
ignore_patterns: &[String],
3232
) -> Result<String, String> {
3333
let mut combined_content = String::new();
3434

@@ -97,7 +97,7 @@ pub async fn handle_results(
9797
}
9898

9999
/// Check if a file should be processed
100-
fn is_valid_file(path: &std::path::Path, repo_path: &std::path::Path, ignore_patterns: &Vec<String>) -> bool {
100+
fn is_valid_file(path: &std::path::Path, repo_path: &std::path::Path, ignore_patterns: &[String]) -> bool {
101101
if path.components().any(|c| c.as_os_str() == ".git") { return false; }
102102
if ignore_due_to_pattern(path, repo_path, ignore_patterns) { return false; }
103103
if !path.is_file() { return false; }
@@ -110,7 +110,7 @@ fn is_valid_file(path: &std::path::Path, repo_path: &std::path::Path, ignore_pat
110110
true
111111
}
112112

113-
fn ignore_due_to_pattern(path: &std::path::Path, repo_path: &std::path::Path, ignore_patterns: &Vec<String>) -> bool {
113+
fn ignore_due_to_pattern(path: &std::path::Path, repo_path: &std::path::Path, ignore_patterns: &[String]) -> bool {
114114
let relative_path_str = match path.strip_prefix(repo_path) {
115115
Ok(p) => p.to_string_lossy().replace("\\", "/"),
116116
Err(_) => return false,

0 commit comments

Comments
 (0)