Skip to content

Commit 07860ed

Browse files
committed
Bump MSRV to 1.77
1 parent cc13951 commit 07860ed

File tree

20 files changed

+51
-70
lines changed

20 files changed

+51
-70
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ keywords = ["opencv", "vision"]
88
license = "MIT"
99
version = "0.93.6"
1010
edition = "2021"
11-
rust-version = "1.66"
11+
rust-version = "1.77.0"
1212
authors = ["Pro <twisted.fall@gmail.com>", "Mathieu Poumeyrol <kali@zoy.org>"]
1313
exclude = ["/.github", "/ci", "/tools", ".editorconfig", ".gitattributes", ".gitignore", "release.toml", "rustfmt.toml"]
1414

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ The following OpenCV versions are supported at the moment:
163163

164164
### Minimum rustc version (MSRV)
165165

166-
Currently, Rust version 1.66.0 or later is required. General policy is that rust version from 1 year ago is supported.
166+
Currently, Rust version 1.77.0 or later is required. General policy is that rust version from 1 year ago is supported.
167167
Bumping versions older than that is not considered a breaking change.
168168

169169
### Platform support

binding-generator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exclude = ["release.toml"]
1515
clang = { version = "2", features = ["clang_6_0"] }
1616
clang-sys = { version = "1", features = ["clang_6_0"] }
1717
dunce = "1"
18-
once_cell = "1" # replace with std::sync::OnceLock when MSRV is 1.70
18+
once_cell = "1" # replace with std::sync::LazyLock when MSRV is 1.80
1919
percent-encoding = { version = "2", default-features = false }
2020
regex = "1"
2121
shlex = { version = "1.3", default-features = false }

binding-generator/src/bin/settings-cleanup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct FunctionFinder<'tu> {
1616
pub gen_env: GeneratorEnv<'tu>,
1717
}
1818

19-
impl<'tu> FunctionFinder<'tu> {
19+
impl FunctionFinder<'_> {
2020
pub fn update_used_func(&self, f: &Func) {
2121
let mut matcher = f.matcher();
2222
self.gen_env.settings.arg_override.get(&mut matcher);
@@ -32,7 +32,7 @@ impl<'tu> FunctionFinder<'tu> {
3232

3333
impl<'tu> EntityWalkerVisitor<'tu> for &mut FunctionFinder<'tu> {
3434
fn wants_file(&mut self, path: &Path) -> bool {
35-
opencv_module_from_path(path).map_or(false, |m| m == self.module)
35+
opencv_module_from_path(path) == Some(self.module)
3636
}
3737

3838
fn visit_entity(&mut self, entity: Entity<'tu>) -> ControlFlow<()> {

binding-generator/src/class.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,7 @@ impl<'tu, 'ge> Class<'tu, 'ge> {
221221
Class::Clang { entity, .. } => entity
222222
.walk_children_while(|f| {
223223
ControlFlow::continue_until(
224-
f.get_kind() == EntityKind::Destructor
225-
&& f.get_accessibility().map_or(true, |acc| acc != Accessibility::Public),
224+
f.get_kind() == EntityKind::Destructor && f.get_accessibility() != Some(Accessibility::Public),
226225
)
227226
})
228227
.is_break(),

binding-generator/src/generator_env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl<'tu> GeneratorEnvPopulator<'tu, '_> {
135135

136136
impl<'tu> EntityWalkerVisitor<'tu> for GeneratorEnvPopulator<'tu, '_> {
137137
fn wants_file(&mut self, path: &Path) -> bool {
138-
is_opencv_path(path) || opencv_module_from_path(path).map_or(false, |m| m == self.module)
138+
is_opencv_path(path) || opencv_module_from_path(path) == Some(self.module)
139139
}
140140

141141
fn visit_entity(&mut self, entity: Entity<'tu>) -> ControlFlow<()> {

binding-generator/src/renderer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl<'s> CppRenderer<'s> {
2929
}
3030
}
3131

32-
impl<'a> TypeRefRenderer<'a> for CppRenderer<'_> {
32+
impl TypeRefRenderer<'_> for CppRenderer<'_> {
3333
type Recursed = Self;
3434

3535
fn render<'t>(self, type_ref: &'t TypeRef) -> Cow<'t, str> {

binding-generator/src/writer/rust_native/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl<'s> RustNativeBindingWriter<'s> {
117117

118118
impl GeneratorVisitor<'_> for RustNativeBindingWriter<'_> {
119119
fn wants_file(&mut self, path: &Path) -> bool {
120-
opencv_module_from_path(path).map_or(false, |m| m == self.module)
120+
opencv_module_from_path(path) == Some(self.module)
121121
}
122122

123123
fn visit_module_comment(&mut self, comment: String) {

binding-generator/src/writer/rust_native/type_ref.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,7 @@ impl TypeRefExt for TypeRef<'_, '_> {
235235
}
236236

237237
fn rust_extern_return_fallible(&self) -> Cow<str> {
238-
if self.kind().is_void() {
239-
"ResultVoid".into()
240-
} else {
241-
format!("Result<{ext}>", ext = self.rust_extern(ExternDir::FromCpp)).into()
242-
}
238+
format!("Result<{ext}>", ext = self.rust_extern(ExternDir::FromCpp)).into()
243239
}
244240

245241
fn rust_lifetime_count(&self) -> usize {

binding-generator/src/writer/rust_native/type_ref/render_lane.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub enum RenderLane<'tu, 'ge> {
7777
SimpleClass(SimpleClassRenderLane<'tu, 'ge>),
7878
}
7979

80-
impl<'tu, 'ge> RenderLane<'tu, 'ge> {
80+
impl RenderLane<'_, '_> {
8181
#[inline(always)]
8282
pub fn to_dyn(&self) -> &dyn RenderLaneTrait {
8383
match self {

0 commit comments

Comments
 (0)