Skip to content

Commit 99a97d9

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 8b2ac35 commit 99a97d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/sphinx_rust/directives/_core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def create_object_xref(
178178
"reftarget": full_name,
179179
}
180180
ref = addnodes.pending_xref(full_name, **options)
181-
name = full_name.split("::")[-1]
181+
name = full_name.rsplit("::", maxsplit=1)[-1]
182182
ref += nodes.literal(name, name)
183183

184184
return ref
@@ -207,7 +207,7 @@ def create_source_xref(
207207
"classes": classes or [],
208208
}
209209
ref = addnodes.pending_xref(full_name, **options)
210-
text = full_name.split("::")[-1] if text is None else text
210+
text = full_name.rsplit("::", maxsplit=1)[-1] if text is None else text
211211
ref += nodes.literal(text, text)
212212

213213
return ref

0 commit comments

Comments
 (0)