Skip to content

Commit 433e430

Browse files
committed
Cleanup
1 parent 3788b29 commit 433e430

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
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

build.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -364,20 +364,14 @@ fn main() -> Result<()> {
364364
eprintln!("=== {v} = {:?}", env::var_os(v));
365365
}
366366
eprintln!("=== Enabled features:");
367-
let features = env::vars().filter_map(|(mut name, val)| {
368-
if val != "1" {
369-
return None;
370-
}
371-
const PREFIX: &str = "CARGO_FEATURE_";
372-
if name.starts_with(PREFIX) {
373-
name.drain(..PREFIX.len());
374-
Some(name)
375-
} else {
376-
None
367+
for (mut name, val) in env::vars() {
368+
if val == "1" {
369+
const PREFIX: &str = "CARGO_FEATURE_";
370+
if name.starts_with(PREFIX) {
371+
name.drain(..PREFIX.len());
372+
eprintln!("=== {name}");
373+
}
377374
}
378-
});
379-
for feature in features {
380-
eprintln!("=== {feature}");
381375
}
382376

383377
let opencv = Library::probe()?;

src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#![allow(rustdoc::broken_intra_doc_links)]
2-
2+
/// Rust bindings for the OpenCV computer vision library
3+
///
4+
/// [Git](https://github.com/twistedfall/opencv-rust) | [Readme](https://github.com/twistedfall/opencv-rust/blob/master/README.md) |
5+
/// [Docs](https://docs.rs/opencv) | [Sponsor](https://github.com/sponsors/twistedfall)
6+
///
7+
/// Please note that this documentation is automatically generated from the C++ headers. So expect references to C++ items,
8+
/// code examples in C++ and other strange things.
39
pub use error::{Error, Result};
410

511
pub use crate::opencv::hub::*;

0 commit comments

Comments
 (0)