Skip to content

Commit 63f6e71

Browse files
cleanup
1 parent 54a8557 commit 63f6e71

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ inherits = "release"
3636
[workspace.dependencies]
3737
log = "0.4"
3838
flexi_logger = "0.28"
39-
anyhow = "1"

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ rayon = "1.10"
2323
serde = { version = "1", features = ["derive"] }
2424
toml = "0.8"
2525
typeshare-core = { path = "../core", version = "1.10.0-beta.7" }
26-
anyhow.workspace = true
2726
log.workspace = true
2827
flexi_logger.workspace = true
28+
anyhow = "1"

core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ description = "The code generator used by Typeshare's command line tool"
77
repository = "https://github.com/1Password/typeshare"
88

99
[dependencies]
10-
anyhow.workspace = true
1110
proc-macro2 = "1"
1211
quote = "1"
1312
syn = { version = "2", features = ["full", "visit"] }
@@ -23,3 +22,4 @@ expect-test = "1.5"
2322
once_cell = "1"
2423
cool_asserts = "2"
2524
syn = { version = "2", features = ["full", "visit", "extra-traits"] }
25+
anyhow = "1"

core/src/target_os_check.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Optional checks for `#[cfg(target_os = "target")]
22
use crate::parser::get_meta_items;
3-
use log::{debug, error, log_enabled};
3+
use log::{debug, error, log_enabled, warn};
44
use quote::ToTokens;
55
use std::collections::VecDeque;
66
use syn::{punctuated::Punctuated, Attribute, Expr, ExprLit, Lit, Meta, Token};
@@ -32,28 +32,33 @@ impl Iterator for TargetOsIterator {
3232

3333
fn next(&mut self) -> Option<Self::Item> {
3434
while let Some(meta) = self.meta.pop_front() {
35-
debug!("working on meta");
3635
if meta.path().is_ident("not") {
3736
debug!("encountered not");
3837
self.scope = TargetScope::Reject
3938
}
4039

4140
match meta {
4241
Meta::Path(p) => {
43-
debug!("\tencountered path: {p:?}");
42+
if log_enabled!(log::Level::Warn) {
43+
warn!(
44+
"Encountered path while traversing target_os candidates: {}",
45+
p.into_token_stream()
46+
);
47+
}
4448
}
4549
Meta::List(meta_list) => {
4650
let nested_meta_list = meta_list
4751
.parse_args_with(Punctuated::<Meta, Token![,]>::parse_terminated)
4852
.inspect_err(|err| {
49-
error!("\tfailed to parse nested meta: {err}");
53+
error!("Failed to parse nested meta while traversing target_os candidates: {err}");
5054
})
5155
.ok()?;
5256
debug!("\texpanding with {} meta", nested_meta_list.len());
5357
self.meta.extend(nested_meta_list);
5458
}
5559
Meta::NameValue(nv) => {
56-
debug!("\tworking on NameValue: {nv:?}");
60+
#[cfg(test)]
61+
debug!("\tworking with NameValue: {nv:?}");
5762
if let Some(value) =
5863
nv.path
5964
.is_ident("target_os")

0 commit comments

Comments
 (0)