From 04ecb4072f65d5a6682a3d706c591a14e351ab42 Mon Sep 17 00:00:00 2001 From: Myrddin Dundragon Date: Wed, 19 Feb 2025 20:07:49 -0500 Subject: [PATCH] [#1] Updated the library to compile for Rust 2021. This was mostly just a change to the cargo edition target. I also went and removed the weave requirement. It was just a function wrapper around the ? operator that was new at that time. As this has become very common place I just swapped the code over to it. --- Cargo.toml | 11 ++++------- src/c_flags.rs | 8 ++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1123ff0..42eae27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "binding" version = "0.1.0" -authors = ["Jason Travis Smith "] +authors = ["Jason Travis Smith "] description = "Defines macros and functions used when binding to C libraries." license = "" -repository = "https://gitlab.com/CyberMages/Core/binding.git" +repository = "https://workshop.cybermages.tech/CyberMages/binding.git" documentation = "" keywords = ["binding", "c types", "c enums", "c flags", "c strings"] -edition = "2018" +edition = "2021" [features] @@ -16,7 +16,4 @@ use_std = ["scribe/use_std"] [dependencies.scribe] -git = "ssh://git@gitlab.com/CyberMages/Core/scribe.git" - -[dependencies.weave] -git = "ssh://git@gitlab.com/CyberMages/Core/weave.git" +git = "ssh://gitea@workshop.cybermages.tech:3022/CyberMages/scribe.git" diff --git a/src/c_flags.rs b/src/c_flags.rs index 4dda8a8..d6604e5 100644 --- a/src/c_flags.rs +++ b/src/c_flags.rs @@ -186,7 +186,7 @@ macro_rules! c_flags let mut first: bool; // Push the left bracket onto the string. - weave::attempt!(write!(f, "{}", '{')); + write!(f, "{}", '{')?; // Handle checking each flag to see if it // is part of this flag. @@ -198,11 +198,11 @@ macro_rules! c_flags // then add an OR symbol. if first == false { - weave::attempt!(write!(f, " | ")); + write!(f, " | ")?; } // Push the flags name onto the string. - weave::attempt!(write!(f, "{}", stringify!($flag))); + write!(f, "{}", stringify!($flag))?; first = false; } )+ @@ -211,7 +211,7 @@ macro_rules! c_flags if first == true { // Put a space in the string. - weave::attempt!(write!(f, " ")); + write!(f, " ")?; } // Push the right bracket onto the string