Skip to content

Commit

Permalink
Updated dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
orium committed Nov 24, 2024
1 parent e261d2c commit 191147f
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 58 deletions.
100 changes: 50 additions & 50 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ include = [
codecov = { repository = "orium/cargo-rdme", branch = "main", service = "github" }

[dependencies]
cargo_metadata = "0.18.1"
clap = "4.5.20"
cargo_metadata = "0.19.0"
clap = "4.5.21"
itertools = "0.13.0"
pulldown-cmark = "0.12.2"
syn = { version = "2.0.85", features = ["full", "extra-traits"] }
thiserror = "2.0.0"
syn = { version = "2.0.89", features = ["full", "extra-traits"] }
thiserror = "2.0.3"
toml = "0.8.19"
# Disable ssh support in git2 to avoid depending on openssl (which fails to build if an unsupported version is found).
git2 = { version = "0.19.0", default-features = false }
Expand Down
15 changes: 11 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#![cfg_attr(feature = "fatal-warnings", deny(warnings))]

use crate::markdown::{Markdown, MarkdownError};
use cargo_metadata::TargetKind;
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use thiserror::Error;
Expand Down Expand Up @@ -88,20 +89,26 @@ impl Project {
}

fn from_package(package: &cargo_metadata::Package) -> Project {
const LIB_CRATE_KINDS: [&str; 6] =
["lib", "dylib", "staticlib", "cdylib", "rlib", "proc-macro"];
const LIB_CRATE_KINDS: [TargetKind; 6] = [
TargetKind::Lib,
TargetKind::DyLib,
TargetKind::StaticLib,
TargetKind::CDyLib,
TargetKind::RLib,
TargetKind::ProcMacro,
];
let lib_packages: Vec<&cargo_metadata::Target> = package
.targets
.iter()
.filter(|target| target.kind.iter().any(|k| LIB_CRATE_KINDS.contains(&k.as_str())))
.filter(|target| target.kind.iter().any(|k| LIB_CRATE_KINDS.contains(k)))
.collect();

assert!(lib_packages.len() <= 1, "more than one lib target");

let lib_package = lib_packages.first();

let bin_packages =
package.targets.iter().filter(|target| target.kind.contains(&"bin".to_owned()));
package.targets.iter().filter(|target| target.kind.contains(&TargetKind::Bin));

let directory = package
.manifest_path
Expand Down

0 comments on commit 191147f

Please sign in to comment.