Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab authored Mar 26, 2024
2 parents 549aa24 + df80cf9 commit 7e33fea
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
patreon: szabgab
github: szabgab
custom: ["https://paypal.me/szabgab"]
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
59 changes: 59 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion download.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cargo run --bin rust-digger-download > /tmp/rust-digger-download.log 2> /tmp/rust-digger-download.err
cargo run --bin rust-digger-download > /tmp/rust-digger-download.log 2> /tmp/rust-digger-download.err
11 changes: 8 additions & 3 deletions src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub fn render_list_page(
filename: &String,
title: &String,
preface: &String,
crates: &Vec<Crate>,
crates: &[Crate],
) -> Result<(), Box<dyn Error>> {
// log::info!("render {filename}");

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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<Crate>, repos: &Vec<Repo>) -> Result<(), Box<dyn Error>> {
pub fn generate_pages(crates: &[Crate], repos: &Vec<Repo>) -> Result<(), Box<dyn Error>> {
log::info!("generate_pages");

create_folders();
Expand Down

0 comments on commit 7e33fea

Please sign in to comment.