Skip to content

Commit 01e72a4

Browse files
committed
tree: fix module docs include path
Upon releasing scylla 1.3.1, a problem arose: the include path passed as an argument to `include_str!` in the `scylla/src/lib.rs` file was only correct when building the project with the workspace set up in the following way, i.e., so that the `scylla-cql` crate is a sibling of the `scylla` crate in the directory tree: ``` ---- scylla-cql |-- scylla ``` However, when packaging the `scylla` crate for distribution, it is placed in a directory with names that do not match the above, i.e.: ``` target/package ---- scylla-cql-<version> |-- scylla-<version> ``` We decided to fix this by adding a symlink in the `scylla/src/deserialize` directory that points to the `scylla-cql/src/deserialize/README.md` file, so that the `include_str!` macro can find it regardless of the directory structure. `cargo publish` will then copy the symlink into the package, ensuring that the documentation is still accessible when building the package.
1 parent 2601813 commit 01e72a4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

scylla/src/deserialize/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../scylla-cql/src/deserialize/README.md

scylla/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub mod serialize {
200200
}
201201

202202
pub mod deserialize {
203-
#![doc = include_str!("../../scylla-cql/src/deserialize/README.md")]
203+
#![doc = include_str!("deserialize/README.md")]
204204

205205
pub use scylla_cql::deserialize::{DeserializationError, FrameSlice, TypeCheckError};
206206

0 commit comments

Comments
 (0)