Skip to content

Commit db08fa8

Browse files
committed
update project
1 parent e582231 commit db08fa8

File tree

7 files changed

+97
-46
lines changed

7 files changed

+97
-46
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/ci-version.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ jobs:
1818
- macos-latest
1919
- windows-latest
2020
toolchain:
21+
- 1.56
2122
- stable
2223
- nightly
23-
name: Test ${{ matrix.toolchain }} on ${{ matrix.os }}
24+
features:
25+
-
26+
name: Test ${{ matrix.toolchain }} on ${{ matrix.os }} (${{ matrix.features }})
2427
runs-on: ${{ matrix.os }}
2528
steps:
26-
- uses: actions/checkout@v2
27-
- uses: actions-rs/toolchain@v1
29+
- uses: actions/checkout@v3
30+
- uses: actions-rust-lang/setup-rust-toolchain@v1
2831
with:
29-
profile: minimal
3032
toolchain: ${{ matrix.toolchain }}
31-
override: true
32-
- run: cargo build --release
33-
- run: cargo test --release
34-
- run: cargo doc --release
33+
- run: cargo test --release ${{ matrix.features }}
34+
- run: cargo doc --release ${{ matrix.features }}

.github/workflows/ci.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,19 @@ jobs:
99
rustfmt:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions-rs/toolchain@v1
12+
- uses: actions/checkout@v3
13+
- uses: actions-rust-lang/setup-rust-toolchain@v1
1414
with:
15-
profile: minimal
1615
toolchain: nightly
17-
override: true
1816
components: rustfmt
19-
- run: cargo fmt -- --check
17+
- uses: actions-rust-lang/rustfmt@v1
2018

2119
clippy:
2220
runs-on: ubuntu-latest
2321
steps:
24-
- uses: actions/checkout@v2
25-
- uses: actions-rs/toolchain@v1
22+
- uses: actions/checkout@v3
23+
- uses: actions-rust-lang/setup-rust-toolchain@v1
2624
with:
27-
profile: minimal
28-
toolchain: nightly
29-
override: true
3025
components: clippy
3126
- run: cargo clippy --all-targets --all-features -- -D warnings
3227

@@ -39,17 +34,17 @@ jobs:
3934
- macos-latest
4035
- windows-latest
4136
toolchain:
37+
- 1.56
4238
- stable
4339
- nightly
44-
name: Test ${{ matrix.toolchain }} on ${{ matrix.os }}
40+
features:
41+
-
42+
name: Test ${{ matrix.toolchain }} on ${{ matrix.os }} (${{ matrix.features }})
4543
runs-on: ${{ matrix.os }}
4644
steps:
47-
- uses: actions/checkout@v2
48-
- uses: actions-rs/toolchain@v1
45+
- uses: actions/checkout@v3
46+
- uses: actions-rust-lang/setup-rust-toolchain@v1
4947
with:
50-
profile: minimal
5148
toolchain: ${{ matrix.toolchain }}
52-
override: true
53-
- run: cargo build
54-
- run: cargo test
55-
- run: cargo doc
49+
- run: cargo test ${{ matrix.features }}
50+
- run: cargo doc ${{ matrix.features }}

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "lazy-static-include"
33
version = "3.1.3"
44
authors = ["Magic Len <len@magiclen.org>"]
55
edition = "2021"
6+
rust-version = "1.56"
67
repository = "https://github.com/magiclen/lazy-static-include"
78
homepage = "https://magiclen.org/lazy-static-include"
89
keywords = ["lazy", "macro", "static", "include"]
@@ -20,7 +21,7 @@ syn = { version = "1", features = ["full"] }
2021
[dev-dependencies]
2122
bencher = "0.1.5"
2223
serde_json = "1.0"
23-
assert_approx_eq = "1.1"
24+
assert-eq-float = "0.1"
2425

2526
slash-formatter = "3.1.3"
2627

benches/bench.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#[macro_use]
22
extern crate lazy_static_include;
33

4-
use std::fs::File;
5-
use std::io::Read;
6-
use std::str::from_utf8_unchecked;
4+
use std::{fs::File, io::Read, str::from_utf8_unchecked};
75

86
use bencher::{benchmark_group, benchmark_main, Bencher};
97
use slash_formatter::concat_with_file_separator;

rustfmt.toml

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,66 @@
1+
# array_width = 60
2+
# attr_fn_like_width = 70
3+
binop_separator = "Front"
4+
blank_lines_lower_bound = 0
5+
blank_lines_upper_bound = 1
16
brace_style = "PreferSameLine"
2-
enum_discrim_align_threshold = 100
3-
force_explicit_abi = false
4-
force_multiline_blocks = true
7+
# chain_width = 60
8+
color = "Auto"
9+
# comment_width = 100
10+
condense_wildcard_suffixes = true
11+
control_brace_style = "AlwaysSameLine"
12+
empty_item_single_line = true
13+
enum_discrim_align_threshold = 80
14+
error_on_line_overflow = false
15+
error_on_unformatted = false
16+
# fn_call_width = 60
17+
fn_params_layout = "Tall"
18+
fn_single_line = false
19+
force_explicit_abi = true
20+
force_multiline_blocks = false
521
format_code_in_doc_comments = true
22+
doc_comment_code_block_width = 80
23+
format_generated_files = true
624
format_macro_matchers = true
25+
format_macro_bodies = true
26+
skip_macro_invocations = []
27+
format_strings = true
28+
hard_tabs = false
29+
hex_literal_case = "Upper"
30+
imports_indent = "Block"
31+
imports_layout = "Mixed"
32+
indent_style = "Block"
33+
inline_attribute_width = 0
34+
match_arm_blocks = true
35+
match_arm_leading_pipes = "Never"
36+
match_block_trailing_comma = true
737
max_width = 100
38+
merge_derives = true
39+
imports_granularity = "Crate"
840
newline_style = "Unix"
41+
normalize_comments = false
942
normalize_doc_attributes = true
1043
overflow_delimited_expr = true
44+
remove_nested_parens = true
1145
reorder_impl_items = true
46+
reorder_imports = true
47+
group_imports = "StdExternalCrate"
48+
reorder_modules = true
49+
short_array_element_width_threshold = 10
50+
# single_line_if_else_max_width = 50
51+
space_after_colon = true
52+
space_before_colon = false
53+
spaces_around_ranges = false
54+
struct_field_align_threshold = 80
1255
struct_lit_single_line = false
56+
# struct_lit_width = 18
57+
# struct_variant_width = 35
58+
tab_spaces = 4
59+
trailing_comma = "Vertical"
60+
trailing_semicolon = true
61+
type_punctuation_density = "Wide"
1362
use_field_init_shorthand = true
14-
use_small_heuristics = "Off"
15-
use_try_shorthand = true
63+
use_small_heuristics = "Max"
64+
use_try_shorthand = true
65+
where_single_line = false
66+
wrap_comments = false

tests/macros.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[macro_use]
22
extern crate lazy_static_include;
33

4-
use assert_approx_eq::assert_approx_eq;
4+
use assert_eq_float::assert_eq_float;
55

66
#[test]
77
fn include_str() {
@@ -191,11 +191,11 @@ fn include_array_f32() {
191191
pub TEST: [f32; 5] => "data/f32_array.txt",
192192
}
193193

194-
assert_approx_eq!(123f32, TEST[0]);
195-
assert_approx_eq!(-456f32, TEST[1]);
196-
assert_approx_eq!(789.5f32, TEST[2]);
197-
assert_approx_eq!(1000.123f32, TEST[3]);
198-
assert_approx_eq!(5000f32, TEST[4]);
194+
assert_eq_float!(123f32, TEST[0]);
195+
assert_eq_float!(-456f32, TEST[1]);
196+
assert_eq_float!(789.5f32, TEST[2]);
197+
assert_eq_float!(1000.123f32, TEST[3]);
198+
assert_eq_float!(5000f32, TEST[4]);
199199
}
200200

201201
#[test]
@@ -204,11 +204,11 @@ fn include_array_f64() {
204204
pub TEST: [f64; 5] => "data/f64_array.txt",
205205
}
206206

207-
assert_approx_eq!(123f64, TEST[0]);
208-
assert_approx_eq!(-456f64, TEST[1]);
209-
assert_approx_eq!(789.5f64, TEST[2]);
210-
assert_approx_eq!(1000.123f64, TEST[3]);
211-
assert_approx_eq!(5000.456f64, TEST[4]);
207+
assert_eq_float!(123f64, TEST[0]);
208+
assert_eq_float!(-456f64, TEST[1]);
209+
assert_eq_float!(789.5f64, TEST[2]);
210+
assert_eq_float!(1000.123f64, TEST[3]);
211+
assert_eq_float!(5000.456f64, TEST[4]);
212212
}
213213

214214
#[test]

0 commit comments

Comments
 (0)