thomasgruebl / rusty-tesseract

A Rust wrapper for Google Tesseract
MIT License
124 stars 14 forks source link

Export existing resources from lib.rs #3

Closed ecashin closed 1 year ago

ecashin commented 1 year ago

I was able to build my trial program by adding a path dependency to my fork of rusty-tesseract and adding this lib.rs re-exporter.

ecashin commented 1 year ago

I think it would be more conventional to have the example usage inside of main moved instead into an examples directory, but this branch makes minimal changes.

thomasgruebl commented 1 year ago

Hi @ecashin, thank you very much for bringing that up!

I've made the changes and when running cargo test I'm getting the following error message:


Doc-tests rusty-tesseract error[E0659]:rusty_tesseract` is ambiguous (name vs any other name during import resolution) --> /home/thomas/Documents/Github/rusty-tesseract/src/lib.rs:5:9 5 pub use rusty_tesseract::*; ^^^^^^^^^^^^^^^ ambiguous name

= note: rusty_tesseract could refer to a crate passed with --extern

= help: use ::rusty_tesseract to refer to this crate unambiguously note: rusty_tesseract could also refer to the module defined here --> /home/thomas/Documents/Github/rusty-tesseract/src/lib.rs:2:1 | 2 | mod rusty_tesseract; | ^^^^^^^^^^^^^^^^^^^^ = help: use crate::rusty_tesseract to refer to this module unambiguously

error: aborting due to previous error

For more information about this error, try rustc --explain E0659. error: test failed, to rerun pass '--doc'`


Apparently line 5 of lib.rs is causing the issue. If you change the line from pub use rusty_tesseract::*; to pub use crate::rusty_tesseract::*; it seems to work. Would you mind changing/testing on your end too, then I can merge the PR.

Thanks,

Thomas

ecashin commented 1 year ago

Hi, I made the change you suggested, but cargo test fails with other problems. I think I'm going to close this pull request and try something else for my application. Thanks for your attention.