[pbs-devel] [PATCH backup 2/4] use C-string literals

Maximiliano Sandoval m.sandoval at proxmox.com
Thu Jun 20 11:00:06 CEST 2024


Requires Rust 1.77.0.

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 Cargo.toml                    | 1 +
 pbs-client/src/pxar/create.rs | 3 +--
 src/api2/node/status.rs       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index abbde299..347b6370 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,6 +13,7 @@ authors = [
 edition = "2021"
 license = "AGPL-3"
 repository = "https://git.proxmox.com/?p=proxmox-backup.git"
+rust-version = "1.77"
 
 [package]
 name = "proxmox-backup"
diff --git a/pbs-client/src/pxar/create.rs b/pbs-client/src/pxar/create.rs
index 89a5b5ab..e5a9f75a 100644
--- a/pbs-client/src/pxar/create.rs
+++ b/pbs-client/src/pxar/create.rs
@@ -27,7 +27,6 @@ use pxar::{EntryKind, Metadata, PxarVariant};
 
 use proxmox_human_byte::HumanByte;
 use proxmox_io::vec;
-use proxmox_lang::c_str;
 use proxmox_sys::fs::{self, acl, xattr};
 
 use pbs_datastore::catalog::BackupCatalogWriter;
@@ -496,7 +495,7 @@ impl Archiver {
     }
 
     fn read_pxar_excludes(&mut self, parent: RawFd) -> Result<(), Error> {
-        let fd = match self.open_file(parent, c_str!(".pxarexclude"), OFlag::O_RDONLY, false)? {
+        let fd = match self.open_file(parent, c".pxarexclude", OFlag::O_RDONLY, false)? {
             Some(fd) => fd,
             None => return Ok(()),
         };
diff --git a/src/api2/node/status.rs b/src/api2/node/status.rs
index 07c20444..78913e4c 100644
--- a/src/api2/node/status.rs
+++ b/src/api2/node/status.rs
@@ -98,7 +98,7 @@ async fn get_status(
         uname.machine(),
     );
 
-    let disk = crate::tools::fs::fs_info_static(proxmox_lang::c_str!("/")).await?;
+    let disk = crate::tools::fs::fs_info_static(c"/").await?;
 
     let boot_info = boot_mode_to_info(boot_mode::BootMode::query(), boot_mode::SecureBoot::query());
 
-- 
2.39.2





More information about the pbs-devel mailing list