Skip to content

Commit 71b8d6f

Browse files
committed
Remove hardcoded version number in the cjson_version function
1 parent e7e49a7 commit 71b8d6f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ pub const CJSON_VERSION_PATCH: u32 = bindings::CJSON_VERSION_PATCH;
1010
///
1111
/// Example:
1212
/// ```rust
13-
/// use cjson_rs::cjson_version;
13+
/// use cjson_rs::*;
1414
///
1515
/// fn main() {
16-
/// assert_eq!(cjson_version(), "1.7.17");
16+
/// assert_eq!(
17+
/// cjson_version(),
18+
/// format!("{}.{}.{}", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH)
19+
/// );
1720
/// println!("Test passed"); // output: Test passed
1821
/// }
1922
/// ```

0 commit comments

Comments
 (0)