Skip to content

Commit 9b8ace7

Browse files
committed
Fix rust 1.86 clippy warnings
* [`manual_div_ceil`] * [`sliced_string_as_bytes`] * Add `cargo.toml` for global clippy settings, e.g. msrv [`manual_div_ceil`]: <https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil> [`sliced_string_as_bytes`]: <https://rust-lang.github.io/rust-clippy/master/index.html#sliced_string_as_bytes>
1 parent 08bc972 commit 9b8ace7

File tree

17 files changed

+17
-2
lines changed

17 files changed

+17
-2
lines changed

clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msrv = "1.81.0"

examples/actix-web-app/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../clippy.toml

examples/axum-app/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../clippy.toml

examples/poem-app/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../clippy.toml

examples/rocket-app/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../clippy.toml

examples/salvo-app/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../clippy.toml

examples/warp-app/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../clippy.toml

fuzzing/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../clippy.toml

rinja/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../clippy.toml

rinja_derive/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../clippy.toml

rinja_derive/src/generator/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl<'a> Generator<'a, '_> {
191191
[] => unreachable!(),
192192
[expr] => self.visit_expr(ctx, buf, expr),
193193
exprs => {
194-
let (l, r) = exprs.split_at((exprs.len() + 1) / 2);
194+
let (l, r) = exprs.split_at(exprs.len().div_ceil(2));
195195
buf.write("rinja::helpers::Concat(&(");
196196
self.visit_concat(ctx, buf, l)?;
197197
buf.write("), &(");

rinja_derive_standalone/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../clippy.toml

rinja_parser/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../clippy.toml

rinja_parser/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl<'a> Span<'a> {
183183
impl<'a> From<&'a str> for Span<'a> {
184184
#[inline]
185185
fn from(value: &'a str) -> Self {
186-
Self(value[..0].as_bytes().try_into().unwrap())
186+
Self(value.as_bytes()[..0].try_into().unwrap())
187187
}
188188
}
189189

testing-alloc/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../clippy.toml

testing-no-std/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../clippy.toml

testing/clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../clippy.toml

0 commit comments

Comments
 (0)