Repository: J-F-Liu/lopdf (language: rust)

Issue:
lopdf 0.30.0 fails to build with default_features = false
Steps to reproduce:
```
$ cargo new lopdf-test
$ cd lopdf-test
$ cargo add lopdf@=0.30.0 --no-default-features
$ cargo build
   Compiling cfg-if v1.0.0
   Compiling crc32fast v1.3.2
   Compiling log v0.4.17
   Compiling adler v1.0.2
   Compiling time-core v0.1.0
   Compiling itoa v1.0.6
   Compiling weezl v0.1.7
   Compiling linked-hash-map v0.5.6
   Compiling encoding_rs v0.8.32
   Compiling miniz_oxide v0.6.2
   Compiling time v0.3.20
   Compiling flate2 v1.0.25
   Compiling lopdf v0.30.0
error[E0432]: unresolved import `object_stream`
  --> /home/tyilo/.cargo/registry/src/github.com-1ecc6299db9ec823/lopdf-0.30.0/src/lib.rs:13:9
   |
13 | pub use object_stream::ObjectStream;
   |         ^^^^^^^^^^^^^ use of undeclared crate or module `object_stream`

error[E0432]: unresolved import `reader`
  --> /home/tyilo/.cargo/registry/src/github.com-1ecc6299db9ec823/lopdf-0.30.0/src/lib.rs:41:9
   |
41 | pub use reader::Reader;
   |         ^^^^^^ use of undeclared crate or module `reader`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `lopdf` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
```


Discussion / hints:
Thanks for the simple reproducible steps, while i'm sure a patch is trivial to implement, in the meantime,
```
cargo add lopdf@=0.30.0 --no-default-features --features nom_parser
```
will build, and will make lopdf much faster anyway.
I'm only using `lopdf` to create PDF's not parse existing ones. So I don't really care how slow parsing is :)

Fix patch:
diff --git a/src/datetime.rs b/src/datetime.rs
index f05559a..5066a6e 100644
--- a/src/datetime.rs
+++ b/src/datetime.rs
@@ -14,6 +14,7 @@ impl From<DateTime<Local>> for Object {
 }
 
 // Find the last `:` and turn it into an `'` to account for PDF weirdness
+#[allow(dead_code)]
 fn convert_utc_offset(bytes: &mut [u8]) {
     let mut index = bytes.len();
     while let Some(last) = bytes[..index].last_mut() {
diff --git a/src/lib.rs b/src/lib.rs
index be022a2..5d39c43 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -10,6 +10,7 @@ pub use crate::object::{Dictionary, Object, ObjectId, Stream, StringFormat};
 mod document;
 mod incremental_document;
 mod object_stream;
+#[cfg(any(feature = "pom_parser", feature = "nom_parser"))]
 pub use object_stream::ObjectStream;
 pub mod xref;
 pub use crate::document::Document;
@@ -38,7 +39,9 @@ mod parser;
 mod parser;
 mod parser_aux;
 mod processor;
+#[cfg(any(feature = "pom_parser", feature = "nom_parser"))]
 mod reader;
+#[cfg(any(feature = "pom_parser", feature = "nom_parser"))]
 pub use reader::Reader;
 mod rc4;
 mod writer;


Test patch: