summaryrefslogtreecommitdiff
path: root/debian/patches/0003-Explicitly-document-trailing-optional-arguments.patch
blob: 252b877f9b8643e9df2f42f85d41329d0e3d8ac8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: Matthew Fennell <matthew@fennell.dev>
Date: Mon, 13 Oct 2025 19:51:45 +0100
Subject: Explicitly document trailing optional arguments

See
https://pyo3.rs/v0.26.0/migration#required-arguments-are-no-longer-accepted-after-optional-arguments.
---
 src/matrix.rs   | 1 +
 src/telegram.rs | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/matrix.rs b/src/matrix.rs
index 305dccc..3a59c29 100644
--- a/src/matrix.rs
+++ b/src/matrix.rs
@@ -22,6 +22,7 @@ const SINGLE_TAGS: &[(&'static str, &'static str)] = &[
 ];
 
 #[pyfunction]
+#[pyo3(signature = (body, mentions=None))]
 pub fn format_for_matrix(body: String, mentions: Option<Vec<(String, usize, usize)>>) -> PyResult<String> {
     let mut chars: Vec<char> = body.chars().collect();
     if chars.len() < 1 {
diff --git a/src/telegram.rs b/src/telegram.rs
index c369744..dbd8825 100644
--- a/src/telegram.rs
+++ b/src/telegram.rs
@@ -13,6 +13,7 @@ const TELEGRAM_STYLES: &[(&'static str, &'static str)] = &[
 ];
 
 #[pyfunction]
+#[pyo3(signature = (body, mentions=None))]
 pub fn format_for_telegram(body: String, mentions: Option<Vec<(String, usize, usize)>>) -> PyResult<(String, Vec<(String, usize, usize, String)>)> {
     let mut chars: Vec<char> = body.chars().collect();
     if chars.len() < 1 {