Skip to content

Commit 50a6fdd

Browse files
committed
Cleanup
1 parent 3788b29 commit 50a6fdd

File tree

23 files changed

+43
-50
lines changed

23 files changed

+43
-50
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ vcpkg = "0.2.9"
4646

4747
[dev-dependencies]
4848
matches = "0.1"
49+
# copy of build-dependencies because we need to test methods of the build script
4950
opencv-binding-generator = { version = "0.93.0", path = "binding-generator" }
50-
cc = { version = ">=1.0.83", features = ["parallel"] }
51+
cc = { version = "1.0.83", features = ["parallel"] }
5152
dunce = "1"
5253
# jobserver-0.1.25 is the first one that has Client::available() method
5354
jobserver = "0.1.25"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ The following variables affect the building the of the `opencv` crate, but belon
142142
```
143143
opencv = { version = ..., default-features = false, features = ["calib3d", "features2d", "flann"]}
144144
```
145+
* `clang-runtime` - enables the runtime detection of libclang (`runtime` feature of `clang-sys`). Useful as a
146+
workaround for when your dependencies (like `bindgen`) pull in `clang-sys` with hard `runtime` feature.
145147
* `rgb` - allow using [`rgb`](https://crates.io/crates/rgb) crate types as `Mat` elements
146148

147149
## API details

binding-generator/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// fixme vector<Mat*> get's interpreted as Vector<Mat> which should be wrong (e.g. Layer::forward and Layer::apply_halide_scheduler)
77
// fixme MatConstIterator::m return Mat**, is it handled correctly?
88
// fixme VectorOfMat::get allows mutation
9+
// fixme MatSize looks like just a pointer inside a Mat so it should take a lifetime
910

1011
// copy-pasted form python generator (may be obsolete):
1112
// fixme returning MatAllocator (trait) by reference is bad, check knearestneighbour

binding-generator/src/smart_ptr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::fmt;
44
use std::rc::Rc;
55

66
use clang::Entity;
7-
87
pub use desc::SmartPtrDesc;
98

109
use crate::element::ExcludeKind;

binding-generator/src/vector.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::fmt;
33
use std::rc::Rc;
44

55
use clang::Type;
6-
76
pub use desc::VectorDesc;
87

98
use crate::element::ExcludeKind;

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ use std::collections::HashMap;
22

33
use once_cell::sync::Lazy;
44

5+
use super::type_ref::TypeRefExt;
6+
use super::RustNativeGeneratedElement;
57
use crate::type_ref::Constness;
68
use crate::writer::rust_native::class::ClassExt;
79
use crate::writer::rust_native::element::RustElement;
810
use crate::{AbstractRefWrapper, CompiledInterpolation, NameStyle, StrExt};
911

10-
use super::type_ref::TypeRefExt;
11-
use super::RustNativeGeneratedElement;
12-
1312
impl RustNativeGeneratedElement for AbstractRefWrapper<'_, '_> {
1413
fn element_order(&self) -> u8 {
1514
10

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ use std::collections::HashMap;
33

44
use once_cell::sync::Lazy;
55

6+
use super::element::{DefaultRustNativeElement, RustElement};
7+
use super::RustNativeGeneratedElement;
68
use crate::debug::NameDebug;
79
use crate::type_ref::{FishStyle, NameStyle};
810
use crate::{CompiledInterpolation, EntityElement, Enum, StrExt};
911

10-
use super::element::{DefaultRustNativeElement, RustElement};
11-
use super::RustNativeGeneratedElement;
12-
1312
impl RustElement for Enum<'_> {
1413
fn rust_module(&self) -> Cow<str> {
1514
DefaultRustNativeElement::rust_module(self.entity())

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
use std::borrow::Cow;
22

3+
use super::element::{DefaultRustNativeElement, RustElement};
34
use crate::field::Field;
45
use crate::type_ref::FishStyle;
56
use crate::writer::rust_native::element::DebugRust;
67
use crate::{reserved_rename, CowMapBorrowedExt, NameStyle, StrExt};
78

8-
use super::element::{DefaultRustNativeElement, RustElement};
9-
109
impl RustElement for Field<'_, '_> {
1110
fn rust_module(&self) -> Cow<str> {
1211
"".into()

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
use std::borrow::Cow;
22

3+
use super::element::RustElement;
4+
use super::type_ref::{NullabilityExt, TypeRefExt};
35
use crate::function::Function;
46
use crate::type_ref::{ExternDir, Nullability};
57
use crate::{NameStyle, StringExt};
68

7-
use super::element::RustElement;
8-
use super::type_ref::{NullabilityExt, TypeRefExt};
9-
109
impl RustElement for Function<'_, '_> {
1110
fn rust_module(&self) -> Cow<str> {
1211
"<unset>".into()

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::{NameStyle, StrExt};
21
use std::borrow::Cow;
32

3+
use crate::{NameStyle, StrExt};
4+
45
pub trait RustStringExt {
56
fn rust_name_from_fullname(&self, style: NameStyle) -> Cow<str>;
67
}

0 commit comments

Comments
 (0)