Skip to content

Commit 9c122d1

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d524d09 commit 9c122d1

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
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

python/sphinx_rust/sphinx_rust.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
__version__: str
42

53
def analyze_crate(crate_path: str, cache_path: str) -> AnalysisResult:

0 commit comments

Comments
 (0)