[PATCH v4 06/11] scripts: generate_rust_analyzer.py: use str(pathlib.Path)

Tamir Duberstein posted 11 patches 9 months ago
There is a newer version of this series
[PATCH v4 06/11] scripts: generate_rust_analyzer.py: use str(pathlib.Path)
Posted by Tamir Duberstein 9 months ago
Use the `/` operator on `pathlib.Path` rather than directly crafting a
string. This is consistent with all other path manipulation in this
script.

Reviewed-by: Fiona Behrens <me@kloenk.dev>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
 scripts/generate_rust_analyzer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
index 0772ea309f94..1ee079c6d916 100755
--- a/scripts/generate_rust_analyzer.py
+++ b/scripts/generate_rust_analyzer.py
@@ -123,7 +123,7 @@ def generate_crates(
         proc_macro_crate: ProcMacroCrate = {
             **crate,
             "is_proc_macro": True,
-            "proc_macro_dylib_path": f"{objtree}/rust/{proc_macro_dylib_name}",
+            "proc_macro_dylib_path": str(objtree / "rust" / proc_macro_dylib_name),
         }
         register_crate(proc_macro_crate)
 

-- 
2.48.1
Re: [PATCH v4 06/11] scripts: generate_rust_analyzer.py: use str(pathlib.Path)
Posted by Daniel Almeida 8 months, 4 weeks ago

> On 22 Mar 2025, at 10:23, Tamir Duberstein <tamird@gmail.com> wrote:
> 
> Use the `/` operator on `pathlib.Path` rather than directly crafting a
> string. This is consistent with all other path manipulation in this
> script.
> 
> Reviewed-by: Fiona Behrens <me@kloenk.dev>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
> ---
> scripts/generate_rust_analyzer.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
> index 0772ea309f94..1ee079c6d916 100755
> --- a/scripts/generate_rust_analyzer.py
> +++ b/scripts/generate_rust_analyzer.py
> @@ -123,7 +123,7 @@ def generate_crates(
>         proc_macro_crate: ProcMacroCrate = {
>             **crate,
>             "is_proc_macro": True,
> -            "proc_macro_dylib_path": f"{objtree}/rust/{proc_macro_dylib_name}",
> +            "proc_macro_dylib_path": str(objtree / "rust" / proc_macro_dylib_name),
>         }
>         register_crate(proc_macro_crate)
> 
> 
> -- 
> 2.48.1
> 
> 

Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>