Skip to content

feat: random_str/src/lib.rs now includes content of its README.md - good for docs.rs#4

Open
peter-lyons-kehl wants to merge 1 commit into
DeimosHall:mainfrom
peter-lyons-kehl:src_include_readme
Open

feat: random_str/src/lib.rs now includes content of its README.md - good for docs.rs#4
peter-lyons-kehl wants to merge 1 commit into
DeimosHall:mainfrom
peter-lyons-kehl:src_include_readme

Conversation

@peter-lyons-kehl

@peter-lyons-kehl peter-lyons-kehl commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Now rustdoc, docs.rs (and probably rust-analyzer-generated docs in IDE mouseovers/tool tips) include and render content README.md.

Side note 1: I see two README.md files. Suggest having just one, and using a symlink from the other location. That may not completely work for developers on Windows, but they can workaround.

Side note 2: both README.md files link to LICENSE, which doesn't exist. EDIT: That's because I made random_str/random_str/src/lib.rs include ../README.md, which is the copy under random_str/random_str and not under the root random_str/. Suggest adding a symlink for LICENSE - I'm happy to add that to this pull request.

Side note 3: Suggest considering dual licensing under Apache-2.0 OR MIT, as is common in Rust ecosystem. (rand does that, too.) Or even triple licensing under Apache-2.0, MIT and BSD (my prudent-rs/prudent or its sister crate (about to be born/named) is going to depend on random_str, and I triple license). For that you could use license = "BSD-2-Clause OR Apache-2.0 OR MIT".

@peter-lyons-kehl

Copy link
Copy Markdown
Contributor Author
random_str/random_str on  main [!] is 📦 v1.1.0 via 🦀 
❯ cargo +1.85.1 rustdoc 
    Checking cfg-if v1.0.4
    Checking rand_core v0.10.1
    Checking libc v0.2.186
    Checking cpufeatures v0.3.0
    Checking chacha20 v0.10.0
    Checking getrandom v0.4.2
    Checking rand v0.10.1
 Documenting random_str v1.1.0 (/share/pkehl/GIT/random_str/random_str)
warning: unresolved link to `LICENSE`
   --> random_str/src/lib.rs:3:1
    |
3   | / //! This crate provides a set of functions to generate random strings, numbers, letters, symbols and bool...
4   | | pub mod random {
5   | |     use rand::{
6   | |         distr::uniform::{SampleRange, SampleUniform},
...   |
122 | |     ///     .build();
123 | |     /// let random_phone_number = format!("+52 {}", digits.unwrap());
    | |_____________________________________________________^
    |
    = note: the link appears in this line:
            
            This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more information.
                                                                              ^^^^^^^
    = note: no item named `LICENSE` in scope
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
    = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

warning: `random_str` (lib doc) generated 1 warning
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 7.34s
   Generated /share/pkehl/GIT/random_str/target/doc/random_str/index.html
image

@DeimosHall

Copy link
Copy Markdown
Owner

Thanks again. I'm fine with your suggestions, feel free to remove one readme, creating the symlinks and adding the triple licensing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants