diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..c947055 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +patreon: szabgab +github: szabgab +custom: ["https://paypal.me/szabgab"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24f931c..7aea578 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: generate: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # - name: Setup Pages # uses: actions/configure-pages@v2 diff --git a/Cargo.toml b/Cargo.toml index 5a13d22..db609f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,3 +40,62 @@ path = "src/clone.rs" [[bin]] name = "rust-digger-download" path = "src/download.rs" + +[lints.clippy] +cargo = { priority = -1, level = "deny" } +complexity = { priority = -1, level = "deny" } +correctness = { priority = -1, level = "deny" } +nursery = { priority = -1, level = "deny" } +pedantic = { priority = -1, level = "deny" } +perf = { priority = -1, level = "deny" } +restriction = { priority = -1, level = "deny" } +style = { priority = -1, level = "deny" } +suspicious = { priority = -1, level = "deny" } + +arithmetic_side_effects = "allow" +as_conversions = "allow" +blanket_clippy_restriction_lints = "allow" +cargo_common_metadata = "allow" +cast_precision_loss = "allow" +exhaustive_structs = "allow" +float_arithmetic = "allow" +implicit_return = "allow" +indexing_slicing = "allow" +integer_division = "allow" +manual_string_new = "allow" +min_ident_chars = "allow" +missing_const_for_fn = "allow" +missing_docs_in_private_items = "allow" +missing_inline_in_public_items = "allow" +missing_panics_doc = "allow" +multiple_crate_versions = "allow" +must_use_candidate = "allow" +needless_raw_strings = "allow" +panic = "allow" +print_stdout = "allow" +shadow_unrelated = "allow" +single_match_else = "allow" +str_to_string = "allow" +uninlined_format_args = "allow" +unwrap_used = "allow" +use_self = "allow" +absolute_paths = "allow" +cast_lossless = "allow" +cast_possible_truncation = "allow" +default_numeric_fallback = "allow" +expect_used = "allow" +get_unwrap = "allow" +ignored_unit_patterns = "allow" +let_underscore_untyped = "allow" +module_name_repetitions = "allow" +panic_in_result_fn = "allow" +question_mark_used = "allow" +semicolon_if_nothing_returned = "allow" +shadow_reuse = "allow" +single_call_fn = "allow" +std_instead_of_core = "allow" +string_slice = "allow" +too_many_lines = "allow" +unnecessary_wraps = "allow" +verbose_file_reads = "allow" +manual_let_else = "allow" diff --git a/download.sh b/download.sh index df08c68..83918c6 100755 --- a/download.sh +++ b/download.sh @@ -1 +1 @@ -cargo run --bin rust-digger-download > /tmp/rust-digger-download.log 2> /tmp/rust-digger-download.err \ No newline at end of file +cargo run --bin rust-digger-download > /tmp/rust-digger-download.log 2> /tmp/rust-digger-download.err diff --git a/src/render.rs b/src/render.rs index 5b705ef..e6fbfbc 100644 --- a/src/render.rs +++ b/src/render.rs @@ -132,7 +132,7 @@ pub fn render_list_page( filename: &String, title: &String, preface: &String, - crates: &Vec, + crates: &[Crate], ) -> Result<(), Box> { // log::info!("render {filename}"); @@ -283,10 +283,15 @@ pub fn generate_user_pages( if let Some(crate_ids) = crates_by_owner.get(&user.id) { //dbg!(crate_ids); for crate_id in crate_ids { + log::info!("crated_id: {}", &crate_id); + //log::info!("crate_by_id: {:#?}", crate_by_id); + //log::info!("crate_by_id: {:#?}", crate_by_id.keys()); //dbg!(&crate_id); //dbg!(&crate_by_id[crate_id.as_str()]); //dbg!(&crate_by_id.get(&crate_id.clone())); - selected_crates.push(crate_by_id[crate_id.as_str()]); + if crate_by_id.contains_key(crate_id.as_str()) { + selected_crates.push(crate_by_id[crate_id.as_str()]); + } } user.count = selected_crates.len() as u16; //users_with_crates.push(user); @@ -455,7 +460,7 @@ pub fn generate_robots_txt() { let mut file = File::create("_site/robots.txt").unwrap(); writeln!(&mut file, "{}", text).unwrap(); } -pub fn generate_pages(crates: &Vec, repos: &Vec) -> Result<(), Box> { +pub fn generate_pages(crates: &[Crate], repos: &Vec) -> Result<(), Box> { log::info!("generate_pages"); create_folders();