diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 000000000..5e90250c4 --- /dev/null +++ b/clippy.toml @@ -0,0 +1 @@ +msrv = "1.81.0" diff --git a/examples/actix-web-app/clippy.toml b/examples/actix-web-app/clippy.toml new file mode 120000 index 000000000..e33e0863d --- /dev/null +++ b/examples/actix-web-app/clippy.toml @@ -0,0 +1 @@ +../../clippy.toml \ No newline at end of file diff --git a/examples/axum-app/clippy.toml b/examples/axum-app/clippy.toml new file mode 120000 index 000000000..e33e0863d --- /dev/null +++ b/examples/axum-app/clippy.toml @@ -0,0 +1 @@ +../../clippy.toml \ No newline at end of file diff --git a/examples/poem-app/clippy.toml b/examples/poem-app/clippy.toml new file mode 120000 index 000000000..e33e0863d --- /dev/null +++ b/examples/poem-app/clippy.toml @@ -0,0 +1 @@ +../../clippy.toml \ No newline at end of file diff --git a/examples/rocket-app/clippy.toml b/examples/rocket-app/clippy.toml new file mode 120000 index 000000000..e33e0863d --- /dev/null +++ b/examples/rocket-app/clippy.toml @@ -0,0 +1 @@ +../../clippy.toml \ No newline at end of file diff --git a/examples/salvo-app/clippy.toml b/examples/salvo-app/clippy.toml new file mode 120000 index 000000000..e33e0863d --- /dev/null +++ b/examples/salvo-app/clippy.toml @@ -0,0 +1 @@ +../../clippy.toml \ No newline at end of file diff --git a/examples/warp-app/clippy.toml b/examples/warp-app/clippy.toml new file mode 120000 index 000000000..e33e0863d --- /dev/null +++ b/examples/warp-app/clippy.toml @@ -0,0 +1 @@ +../../clippy.toml \ No newline at end of file diff --git a/fuzzing/clippy.toml b/fuzzing/clippy.toml new file mode 120000 index 000000000..85f6167cb --- /dev/null +++ b/fuzzing/clippy.toml @@ -0,0 +1 @@ +../clippy.toml \ No newline at end of file diff --git a/rinja/clippy.toml b/rinja/clippy.toml new file mode 120000 index 000000000..85f6167cb --- /dev/null +++ b/rinja/clippy.toml @@ -0,0 +1 @@ +../clippy.toml \ No newline at end of file diff --git a/rinja_derive/clippy.toml b/rinja_derive/clippy.toml new file mode 120000 index 000000000..85f6167cb --- /dev/null +++ b/rinja_derive/clippy.toml @@ -0,0 +1 @@ +../clippy.toml \ No newline at end of file diff --git a/rinja_derive/src/generator/expr.rs b/rinja_derive/src/generator/expr.rs index cd03bbcf9..9611bbfd4 100644 --- a/rinja_derive/src/generator/expr.rs +++ b/rinja_derive/src/generator/expr.rs @@ -191,7 +191,7 @@ impl<'a> Generator<'a, '_> { [] => unreachable!(), [expr] => self.visit_expr(ctx, buf, expr), exprs => { - let (l, r) = exprs.split_at((exprs.len() + 1) / 2); + let (l, r) = exprs.split_at(exprs.len().div_ceil(2)); buf.write("rinja::helpers::Concat(&("); self.visit_concat(ctx, buf, l)?; buf.write("), &("); diff --git a/rinja_derive_standalone/clippy.toml b/rinja_derive_standalone/clippy.toml new file mode 120000 index 000000000..85f6167cb --- /dev/null +++ b/rinja_derive_standalone/clippy.toml @@ -0,0 +1 @@ +../clippy.toml \ No newline at end of file diff --git a/rinja_parser/clippy.toml b/rinja_parser/clippy.toml new file mode 120000 index 000000000..85f6167cb --- /dev/null +++ b/rinja_parser/clippy.toml @@ -0,0 +1 @@ +../clippy.toml \ No newline at end of file diff --git a/rinja_parser/src/lib.rs b/rinja_parser/src/lib.rs index 23e0eb143..51827c884 100644 --- a/rinja_parser/src/lib.rs +++ b/rinja_parser/src/lib.rs @@ -183,7 +183,7 @@ impl<'a> Span<'a> { impl<'a> From<&'a str> for Span<'a> { #[inline] fn from(value: &'a str) -> Self { - Self(value[..0].as_bytes().try_into().unwrap()) + Self(value.as_bytes()[..0].try_into().unwrap()) } } diff --git a/testing-alloc/clippy.toml b/testing-alloc/clippy.toml new file mode 120000 index 000000000..85f6167cb --- /dev/null +++ b/testing-alloc/clippy.toml @@ -0,0 +1 @@ +../clippy.toml \ No newline at end of file diff --git a/testing-no-std/clippy.toml b/testing-no-std/clippy.toml new file mode 120000 index 000000000..85f6167cb --- /dev/null +++ b/testing-no-std/clippy.toml @@ -0,0 +1 @@ +../clippy.toml \ No newline at end of file diff --git a/testing/clippy.toml b/testing/clippy.toml new file mode 120000 index 000000000..85f6167cb --- /dev/null +++ b/testing/clippy.toml @@ -0,0 +1 @@ +../clippy.toml \ No newline at end of file