Skip to content

Commit d8ca333

Browse files
committed
chore: bump msrv and fix clippy warnings
1 parent 0621518 commit d8ca333

File tree

28 files changed

+285
-291
lines changed

28 files changed

+285
-291
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Ivan Kalinin <i.kalinin@dexpa.io>"]
55
repository = "https://github.com/broxus/tycho-types"
66
version = "0.2.1"
77
edition = "2024"
8-
rust-version = "1.85"
8+
rust-version = "1.88"
99
include = ["src/**/*.rs", "benches/**/*.rs", "LICENSE-*", "README.md"]
1010
license = "MIT OR Apache-2.0"
1111

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
[crates-io-link]: https://crates.io/crates/tycho-types
55
[docs-badge]: https://docs.rs/tycho-types/badge.svg
66
[docs-url]: https://docs.rs/tycho-types
7-
[rust-version-badge]: https://img.shields.io/badge/rustc-1.85+-lightgray.svg
8-
[rust-version-link]: https://blog.rust-lang.org/2025/02/20/Rust-1.85.0/
7+
[rust-version-badge]: https://img.shields.io/badge/rustc-1.88+-lightgray.svg
8+
[rust-version-link]: https://blog.rust-lang.org/2025/06/26/Rust-1.88.0/
99
[workflow-badge]: https://img.shields.io/github/actions/workflow/status/broxus/tycho-types/master.yml?branch=master
1010
[workflow-link]: https://github.com/broxus/tycho-types/actions?query=workflow%3Amaster
1111

abi-proc/src/internals/container.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,23 @@ pub fn with_bound(fields: &Fields, generics: &syn::Generics, bound: &syn::Path)
4646

4747
impl<'ast> Visit<'ast> for FindTyParams<'ast> {
4848
fn visit_field(&mut self, field: &'ast syn::Field) {
49-
if let syn::Type::Path(ty) = ungroup(&field.ty) {
50-
if let Some(Pair::Punctuated(t, _)) = ty.path.segments.pairs().next() {
51-
if self.all_type_params.contains(&t.ident) {
52-
self.associated_type_usage.push(ty);
53-
}
54-
}
49+
if let syn::Type::Path(ty) = ungroup(&field.ty)
50+
&& let Some(Pair::Punctuated(t, _)) = ty.path.segments.pairs().next()
51+
&& self.all_type_params.contains(&t.ident)
52+
{
53+
self.associated_type_usage.push(ty);
5554
}
55+
5656
self.visit_type(&field.ty);
5757
}
5858

5959
fn visit_macro(&mut self, _mac: &'ast syn::Macro) {}
6060

6161
fn visit_path(&mut self, path: &'ast syn::Path) {
62-
if let Some(seg) = path.segments.last() {
63-
if seg.ident == "PhantomData" {
64-
return;
65-
}
62+
if let Some(seg) = path.segments.last()
63+
&& seg.ident == "PhantomData"
64+
{
65+
return;
6666
}
6767
if path.leading_colon.is_none() && path.segments.len() == 1 {
6868
let id = &path.segments[0].ident;

abi-proc/src/internals/field.rs

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,25 @@ pub struct FieldAttributes {
4141

4242
impl FieldAttributes {
4343
pub fn check(&self) -> Result<(), Error> {
44-
if let Some(path) = &self.mod_handler {
45-
if self.with_handlers.into_abi_handler.is_some()
46-
&& self.with_handlers.from_abi_handler.is_some()
47-
&& self.with_handlers.as_abi_handler.is_some()
48-
&& self.with_handlers.abi_type_handler.is_some()
49-
{
50-
return Err(Error::new_spanned(
51-
path,
52-
"`with` parameter should not be used simultaneously with other handling parameters",
53-
));
54-
}
44+
if let Some(path) = &self.mod_handler
45+
&& self.with_handlers.into_abi_handler.is_some()
46+
&& self.with_handlers.from_abi_handler.is_some()
47+
&& self.with_handlers.as_abi_handler.is_some()
48+
&& self.with_handlers.abi_type_handler.is_some()
49+
{
50+
return Err(Error::new_spanned(
51+
path,
52+
"all `with` module methods are shadowed by explicit attributes",
53+
));
5554
}
5655

57-
if let Some(path) = &self.with_handlers.into_abi_handler {
58-
if self.with_handlers.as_abi_handler.is_none() {
59-
return Err(Error::new_spanned(
60-
path,
61-
"`into_abi_with` also requires `as_abi_with`",
62-
));
63-
}
56+
if let Some(path) = &self.with_handlers.into_abi_handler
57+
&& self.with_handlers.as_abi_handler.is_none()
58+
{
59+
return Err(Error::new_spanned(
60+
path,
61+
"`into_abi_with` also requires `as_abi_with`",
62+
));
6463
}
6564

6665
Ok(())

fuzz/fuzz_targets/base64_addr.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ use libfuzzer_sys::{Corpus, fuzz_target};
33
use tycho_types::models::{StdAddr, StdAddrFormat};
44

55
fuzz_target!(|data: &[u8]| -> Corpus {
6-
if let Ok(s) = std::str::from_utf8(data) {
7-
if StdAddr::from_str_ext(s, StdAddrFormat::any()).is_ok() {
8-
return Corpus::Keep;
9-
}
6+
if let Ok(s) = std::str::from_utf8(data)
7+
&& StdAddr::from_str_ext(s, StdAddrFormat::any()).is_ok()
8+
{
9+
return Corpus::Keep;
1010
}
1111
Corpus::Reject
1212
});

fuzz/fuzz_targets/boc_decode.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ use libfuzzer_sys::fuzz_target;
33
use tycho_types::prelude::Boc;
44

55
fuzz_target!(|data: &[u8]| {
6-
if let Ok(cell) = Boc::decode(data) {
7-
if let Ok(mut slice) = cell.as_slice() {
6+
if let Ok(cell) = Boc::decode(data)
7+
&& let Ok(mut slice) = cell.as_slice()
8+
{
9+
_ = slice.get_u8(0);
10+
_ = slice.get_u16(0);
11+
_ = slice.get_u32(0);
12+
_ = slice.get_u64(0);
13+
_ = slice.get_u128(0);
14+
_ = slice.get_u256(0);
15+
if slice.skip_first(3, 0).is_ok() {
816
_ = slice.get_u8(0);
917
_ = slice.get_u16(0);
1018
_ = slice.get_u32(0);
1119
_ = slice.get_u64(0);
1220
_ = slice.get_u128(0);
1321
_ = slice.get_u256(0);
14-
if slice.skip_first(3, 0).is_ok() {
15-
_ = slice.get_u8(0);
16-
_ = slice.get_u16(0);
17-
_ = slice.get_u32(0);
18-
_ = slice.get_u64(0);
19-
_ = slice.get_u128(0);
20-
_ = slice.get_u256(0);
21-
}
2222
}
2323
}
2424
});

fuzz/fuzz_targets/boc_dict.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ use libfuzzer_sys::{Corpus, fuzz_target};
33
use tycho_types::prelude::{Boc, RawDict};
44

55
fuzz_target!(|data: &[u8]| -> Corpus {
6-
if let Ok(cell) = Boc::decode(data) {
7-
if let Ok(map) = cell.parse::<RawDict<32>>() {
8-
_ = map.iter().count();
9-
return Corpus::Keep;
10-
}
6+
if let Ok(cell) = Boc::decode(data)
7+
&& let Ok(map) = cell.parse::<RawDict<32>>()
8+
{
9+
_ = map.iter().count();
10+
return Corpus::Keep;
1111
}
1212
Corpus::Reject
1313
});

fuzz/fuzz_targets/boc_message.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ use tycho_types::models::Message;
44
use tycho_types::prelude::Boc;
55

66
fuzz_target!(|data: &[u8]| -> Corpus {
7-
if let Ok(cell) = Boc::decode(data) {
8-
if cell.parse::<Message>().is_ok() {
9-
return Corpus::Keep;
10-
}
7+
if let Ok(cell) = Boc::decode(data)
8+
&& cell.parse::<Message>().is_ok()
9+
{
10+
return Corpus::Keep;
1111
}
1212
Corpus::Reject
1313
});

fuzz/fuzz_targets/common.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ where
1818
let ctx = Cell::empty_context();
1919

2020
let initial =
21-
dict::build_aug_dict_from_sorted_iter(self.initial_items.into_iter(), A::comp_add, ctx)
22-
.unwrap();
21+
dict::build_aug_dict_from_sorted_iter(self.initial_items, A::comp_add, ctx).unwrap();
2322

2423
// Build manually
2524
let mut target = initial.clone();

fuzz/fuzz_targets/dict_modify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ where
1313
{
1414
let ctx = Cell::empty_context();
1515

16-
let initial = dict::build_dict_from_sorted_iter(input.initial_items.into_iter(), ctx).unwrap();
16+
let initial = dict::build_dict_from_sorted_iter(input.initial_items, ctx).unwrap();
1717

1818
// Build manually
1919
let mut target = initial.clone();

0 commit comments

Comments
 (0)