Skip to content

Commit 0b9d3fc

Browse files
fix: clean warnings; modernize CI to tag-triggered publish
- Remove unused BTreeMap import (lib.rs) - Remove unused TomllmError import (parser.rs) - Prefix _is_annotation to silence unused-variable warning - rust-ci.yml: actions-rs/toolchain → dtolnay/rust-toolchain (maintained) - rust-ci.yml: publish gated on v* tags, not every main push Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b4bf8da commit 0b9d3fc

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

.github/workflows/rust-ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Rust CI
33
on:
44
push:
55
branches: [main]
6+
tags: ["v*"]
67
pull_request:
78
branches: [main]
89

@@ -11,20 +12,19 @@ jobs:
1112
runs-on: ubuntu-latest
1213
steps:
1314
- uses: actions/checkout@v4
14-
- uses: actions-rs/toolchain@v1
15-
with:
16-
toolchain: stable
17-
override: true
18-
- run: cargo test --all-features
15+
- uses: dtolnay/rust-toolchain@stable
16+
- run: cargo test
17+
# 🤓 wasm feature compiles to rlib on native — wasm32 target only needed for actual WASM artifact
18+
- run: cargo test --features wasm
1919

2020
publish-crate:
21+
name: Publish to crates.io
2122
needs: test
22-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
23+
# 🤓 gate on tags (v*) — push a `git tag v0.1.0 && git push --tags` to trigger
24+
if: startsWith(github.ref, 'refs/tags/v')
2325
runs-on: ubuntu-latest
2426
steps:
2527
- uses: actions/checkout@v4
26-
- uses: actions-rs/toolchain@v1
27-
with:
28-
toolchain: stable
29-
override: true
30-
- run: cargo publish --token ${{ secrets.CRATESIO_API_TOKEN }}
28+
- uses: dtolnay/rust-toolchain@stable
29+
- name: Publish
30+
run: cargo publish --token ${{ secrets.CRATESIO_API_TOKEN }}

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
//! # tier: sm0l
3131
//! ```
3232
33-
use std::collections::BTreeMap;
3433
use thiserror::Error;
3534

3635
#[cfg(feature = "wasm")]

src/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::collections::BTreeMap;
44
use serde::{Deserialize, Serialize};
55

6-
use crate::{Result, TomllmError};
6+
use crate::Result;
77
use crate::map_block::MapBlock;
88
use crate::stripper::{extract_comments, strip};
99

@@ -99,7 +99,7 @@ impl TomllmDoc {
9999

100100
for (line_idx, comment_text) in &all_comments {
101101
// Check if this is an annotation-style comment
102-
let is_annotation = ANNOTATION_PREFIXES
102+
let _is_annotation = ANNOTATION_PREFIXES
103103
.iter()
104104
.any(|prefix| comment_text.starts_with(prefix));
105105

0 commit comments

Comments
 (0)