about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-03-27 13:00:49 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-03-27 13:00:49 +0100
commitf333ad8656af7a43559805a9a321da8cf618d0c1 (patch)
tree799058507067e1b09131a81e5b01622a16111d34
parentbe13105d737545a4a5f0aa0709342b4db8f2f1e3 (diff)
downloadrust-f333ad8656af7a43559805a9a321da8cf618d0c1.tar.gz
rust-f333ad8656af7a43559805a9a321da8cf618d0c1.zip
Improve code comment
-rw-r--r--src/librustdoc/doctest/make.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/doctest/make.rs b/src/librustdoc/doctest/make.rs
index 512343693bc..46226a8bc71 100644
--- a/src/librustdoc/doctest/make.rs
+++ b/src/librustdoc/doctest/make.rs
@@ -334,8 +334,8 @@ fn parse_source(source: &str, crate_name: &Option<&str>) -> Result<ParseSourceIn
         prev_span_hi: &mut Option<usize>,
     ) {
         let extra_len = DOCTEST_CODE_WRAPPER.len();
-        // We need to shift by 1 because we added `{` at the beginning of the source.we provided
-        // to the parser.
+        // We need to shift by the length of `DOCTEST_CODE_WRAPPER` because we
+        // added it at the beginning of the source we provided to the parser.
         let lo = prev_span_hi.unwrap_or(0);
         let mut hi = span.hi().0 as usize - extra_len;
         if hi > source.len() {