Skip to content

Commit efabe4f

Browse files
ref(docs): make rot13 docs consistent (#80)
1 parent 1d0b131 commit efabe4f

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/ciphers/rot13.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
1-
//! Rot13 or "rotate by 13 places"
2-
//!
3-
//! # Algorithm
4-
5-
/// Encrypts a given [`&str`] using ROT13 cipher.
1+
/// Encrypts a given [`&str`] using ROT13 cipher or "rotate by 13 places"
62
///
73
/// See [ROT13](https://en.wikipedia.org/wiki/ROT13) for more information.
84
///
95
/// Replaces each character with the 13th letter after it in the alphabet.
10-
/// Rot13 is a special case of [Caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher)
6+
/// Rot13 is a special case of a [Caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher)
117
///
128
/// The most basic example is ROT 13, which rotates 'a' to 'n'.
139
/// This implementation does not rotate unicode characters.
1410
///
1511
/// # Arguments
1612
///
17-
/// `text` - String to transform.
13+
/// * `text` - String to transform.
1814
///
1915
/// # Returns
2016
///
21-
/// An owned [`String`]
22-
///
23-
/// # Panic
24-
///
25-
/// This function won't panic.
17+
/// An owned [`String`] with the transformed text.
2618
///
2719
/// # Examples
28-
/// ```
29-
/// # use rust_algorithms::ciphers::rot13;
20+
/// ```rust
21+
/// use rust_algorithms::ciphers::rot13;
22+
///
3023
/// let encoded = rot13("hello world");
24+
///
3125
/// assert_eq!(encoded, "URYYB JBEYQ");
3226
/// ```
3327
pub fn rot13(text: &str) -> String {

0 commit comments

Comments
 (0)