Skip to content

Commit 4464ab7

Browse files
authored
fix not to break relative path link (#4042)
1 parent 4488e40 commit 4464ab7

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

rustfmt-core/rustfmt-lib/src/string.rs

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ fn detect_url(s: &[&str], index: usize) -> Option<usize> {
169169
|| split.contains("http://")
170170
|| split.contains("ftp://")
171171
|| split.contains("file://")
172+
|| split.contains("./")
172173
{
173174
match s[index..].iter().position(|g| is_whitespace(g)) {
174175
Some(pos) => Some(index + pos - 1),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// rustfmt-max_width: 100
2+
// rustfmt-wrap_comments: true
3+
// rustfmt-comment_width: 80
4+
// rustfmt-normalize_comments: true
5+
// rustfmt-unstable_features: true
6+
7+
struct Test {
8+
/// [`MANAGE_MESSAGES`]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
9+
/// [`MANAGE_CHANNEL`]: ./permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNEL
10+
#[serde(default, rename = "rate_limit_per_user")]
11+
pub rate_limit: u16,
12+
}

0 commit comments

Comments
 (0)