Skip to content

Conversation

@aburkhalter512
Copy link
Collaborator

Fixes the code example in the README. The root of the problem was that the instance of the integer doesn't implement DependencyClone so replacing it with a reference fixes the problem. I additionally wrapped it in a struct to better represent actual usage (I don't expect raw integers to be added as instances as standard practice. Wrapping them in a "config" struct seems more likely)

Fixes #28

@aburkhalter512 aburkhalter512 requested a review from p0lunin May 28, 2022 04:25
@@ -0,0 +1,46 @@
use teloc::*;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this test to ensure that the code in the example compiles

Copy link
Owner

@p0lunin p0lunin Jul 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can test readme examples using such hack (taken from teloxide):

#[cfg(all(feature = "nightly", doctest))]
#[cfg_attr(feature = "nightly", cfg_attr(feature = "nightly", doc = include_str!("../README.md")))]
enum ReadmeDocTests {}

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.

Example still fails on latest Rust

2 participants