Skip to content

Commit c1954ec

Browse files
authored
Merge pull request #143 from epage/template
chore: Update from _rust/main template
2 parents 6eea4ad + c52da19 commit c1954ec

File tree

8 files changed

+35
-37
lines changed

8 files changed

+35
-37
lines changed

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[resolver]
2+
incompatible-rust-versions = "fallback"
3+
14
[target.x86_64-pc-windows-msvc]
25
rustflags = ["-Ctarget-feature=+crt-static"]
36

.github/renovate.json5

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
customManagers: [
1010
{
1111
customType: 'regex',
12-
fileMatch: [
13-
'^rust-toolchain\\.toml$',
14-
'Cargo.toml$',
15-
'clippy.toml$',
16-
'\\.clippy.toml$',
17-
'^\\.github/workflows/ci.yml$',
18-
'^\\.github/workflows/rust-next.yml$',
12+
managerFilePatterns: [
13+
'/^rust-toolchain\\.toml$/',
14+
'/Cargo.toml$/',
15+
'/clippy.toml$/',
16+
'/\\.clippy.toml$/',
17+
'/^\\.github/workflows/ci.yml$/',
18+
'/^\\.github/workflows/rust-next.yml$/',
1919
],
2020
matchStrings: [
2121
'STABLE.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: Build
5555
run: cargo test --workspace --no-run
5656
- name: Test
57-
run: cargo hack test --feature-powerset --workspace
57+
run: cargo hack test --each-feature --workspace
5858
msrv:
5959
name: "Check MSRV"
6060
runs-on: ubuntu-latest
@@ -68,7 +68,7 @@ jobs:
6868
- uses: Swatinem/rust-cache@v2
6969
- uses: taiki-e/install-action@cargo-hack
7070
- name: Default features
71-
run: cargo hack check --feature-powerset --locked --rust-version --ignore-private --workspace --all-targets
71+
run: cargo hack check --each-feature --locked --rust-version --ignore-private --workspace --all-targets --keep-going
7272
lockfile:
7373
runs-on: ubuntu-latest
7474
steps:
@@ -95,7 +95,7 @@ jobs:
9595
- name: Check documentation
9696
env:
9797
RUSTDOCFLAGS: -D warnings
98-
run: cargo doc --workspace --all-features --no-deps --document-private-items
98+
run: cargo doc --workspace --all-features --no-deps --document-private-items --keep-going
9999
rustfmt:
100100
name: rustfmt
101101
runs-on: ubuntu-latest
@@ -141,7 +141,7 @@ jobs:
141141
sarif_file: clippy-results.sarif
142142
wait-for-processing: true
143143
- name: Report status
144-
run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated
144+
run: cargo clippy --workspace --all-features --all-targets --keep-going -- -D warnings --allow deprecated
145145
coverage:
146146
name: Coverage
147147
runs-on: ubuntu-latest

.github/workflows/rust-next.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Build
4545
run: cargo test --workspace --no-run
4646
- name: Test
47-
run: cargo hack test --feature-powerset --workspace
47+
run: cargo hack test --each-feature --workspace
4848
latest:
4949
name: "Check latest dependencies"
5050
runs-on: ubuntu-latest
@@ -66,4 +66,4 @@ jobs:
6666
- name: Build
6767
run: cargo test --workspace --no-run
6868
- name: Test
69-
run: cargo hack test --feature-powerset --workspace
69+
run: cargo hack test --each-feature --workspace

.pre-commit-config.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
1+
default_install_hook_types: ["pre-commit", "commit-msg"]
12
repos:
23
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
4+
rev: v5.0.0
45
hooks:
56
- id: check-yaml
6-
stages: [commit]
77
- id: check-json
8-
stages: [commit]
98
- id: check-toml
10-
stages: [commit]
119
- id: check-merge-conflict
12-
stages: [commit]
1310
- id: check-case-conflict
14-
stages: [commit]
1511
- id: detect-private-key
16-
stages: [commit]
1712
- repo: https://github.com/crate-ci/typos
18-
rev: v1.16.20
13+
rev: v1.32.0
1914
hooks:
2015
- id: typos
21-
stages: [commit]
2216
- repo: https://github.com/crate-ci/committed
23-
rev: v1.0.20
17+
rev: v1.1.7
2418
hooks:
2519
- id: committed
26-
stages: [commit-msg]

Cargo.toml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ include = [
1313
"Cargo.lock",
1414
"LICENSE*",
1515
"README.md",
16-
"benches/**/*",
1716
"examples/**/*"
1817
]
1918

2019
[workspace.lints.rust]
2120
rust_2018_idioms = { level = "warn", priority = -1 }
21+
unnameable_types = "warn"
2222
unreachable_pub = "warn"
2323
unsafe_op_in_unsafe_fn = "warn"
2424
unused_lifetimes = "warn"
@@ -61,7 +61,7 @@ lossy_float_literal = "warn"
6161
macro_use_imports = "warn"
6262
mem_forget = "warn"
6363
mutex_integer = "warn"
64-
needless_continue = "warn"
64+
needless_continue = "allow"
6565
needless_for_each = "warn"
6666
negative_feature_names = "warn"
6767
path_buf_push_overwrite = "warn"
@@ -86,6 +86,15 @@ verbose_file_reads = "warn"
8686
wildcard_imports = "warn"
8787
zero_sized_map_values = "warn"
8888

89+
[profile.dev]
90+
panic = "abort"
91+
92+
[profile.release]
93+
panic = "abort"
94+
codegen-units = 1
95+
lto = true
96+
# debug = "line-tables-only" # requires Cargo 1.71
97+
8998
[package]
9099
name = "git-dive"
91100
description = "Dive into a file's history to find root cause"
@@ -152,13 +161,5 @@ automod = "1.0.14"
152161
default = ["vendored-libgit2"]
153162
vendored-libgit2 = ["git2/vendored-libgit2"]
154163

155-
[profile.dev]
156-
panic = "abort"
157-
158-
[profile.release]
159-
panic = "abort"
160-
codegen-units = 1
161-
lto = true
162-
163164
[lints]
164165
workspace = true

deny.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ allow = [
9595
"ISC",
9696
"BSD-2-Clause",
9797
"OpenSSL",
98+
"Zlib",
9899
]
99100
# The confidence threshold for detecting a license from license text.
100101
# The higher the value, the more closely the license text must be to the

src/assets/lazy_theme_set.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use syntect::highlighting::{Theme, ThemeSet};
1313
/// Same structure as a [`syntect::highlighting::ThemeSet`] but with themes
1414
/// stored in raw serialized form, and deserialized on demand.
1515
#[derive(Debug, Default, Serialize, Deserialize)]
16-
pub struct LazyThemeSet {
16+
pub(crate) struct LazyThemeSet {
1717
/// This is a [`BTreeMap`] because that's what [`syntect::highlighting::ThemeSet`] uses
1818
themes: BTreeMap<String, LazyTheme>,
1919
}
@@ -30,7 +30,7 @@ struct LazyTheme {
3030

3131
impl LazyThemeSet {
3232
/// Lazily load the given theme
33-
pub fn get(&self, name: &str) -> Option<&Theme> {
33+
pub(crate) fn get(&self, name: &str) -> Option<&Theme> {
3434
self.themes.get(name).and_then(|lazy_theme| {
3535
lazy_theme
3636
.deserialized
@@ -40,7 +40,7 @@ impl LazyThemeSet {
4040
}
4141

4242
/// Returns the name of all themes.
43-
pub fn themes(&self) -> impl Iterator<Item = &str> {
43+
pub(crate) fn themes(&self) -> impl Iterator<Item = &str> {
4444
self.themes.keys().map(|name| name.as_ref())
4545
}
4646
}

0 commit comments

Comments
 (0)