Skip to content

Commit 3ca1187

Browse files
committed
Fix Rust SDK review issues
1 parent f580f21 commit 3ca1187

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/SDK/Language/Rust.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ public function getFilters(): array
550550
new TwigFilter(
551551
"rustdocComment",
552552
function ($value, $indent = 0) {
553+
$value = str_replace("passwird", "password", $value);
553554
$value = trim($value);
554555
$value = explode("\n", $value);
555556
$indent = \str_repeat(" ", $indent);
@@ -795,7 +796,7 @@ protected function getDocsArgumentExample(array $param, string $crateName): stri
795796
$value = $this->getIdentifierOverrides()[$value];
796797
}
797798

798-
return ($param["required"] ?? false) ? $value : "Some({$value})";
799+
return (($param["required"] ?? false) && !($param["nullable"] ?? false)) ? $value : "Some({$value})";
799800
}
800801

801802
if (!empty($param["enumValues"]) || !empty($param["enumName"])) {
@@ -804,7 +805,7 @@ protected function getDocsArgumentExample(array $param, string $crateName): stri
804805
$value = $this->getParamExample($param);
805806
}
806807

807-
return ($param["required"] ?? false) ? $value : "Some({$value})";
808+
return (($param["required"] ?? false) && !($param["nullable"] ?? false)) ? $value : "Some({$value})";
808809
}
809810

810811
/**

templates/rust/Cargo.toml.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ serde_json = "1.0.149"
2323
reqwest = { version = "0.12.28", features = ["json", "multipart", "stream"] }
2424
tokio = { version = "1.48.0", features = ["full"] }
2525
indexmap = ">=2, <2.14"
26-
url = "=2.5.4"
27-
idna = "=1.0.3"
28-
idna_adapter = "=1.0.0"
26+
url = ">=2.5.4, <2.6"
27+
idna = ">=1.0.3, <1.2"
28+
idna_adapter = ">=1.0.0, <1.1"
2929
mime = "0.3.17"
3030
fastrand = "=2.0.2"
3131
thiserror = "1.0.69"

0 commit comments

Comments
 (0)