From 0270aff0008173cd4701ebd4cd00386074bec2b9 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 29 Nov 2024 00:54:05 +1100 Subject: [PATCH] Fix lifetime annotations --- src/flags.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/flags.rs b/src/flags.rs index a00fa3ea..3d2d278c 100644 --- a/src/flags.rs +++ b/src/flags.rs @@ -22,9 +22,9 @@ pub(crate) struct RustcCodegenFlags<'a> { soft_float: Option, } -impl RustcCodegenFlags { +impl RustcCodegenFlags<'_> { // Parse flags obtained from CARGO_ENCODED_RUSTFLAGS - pub(crate) fn parse(rustflags_env: &str) -> Result { + pub(crate) fn parse(rustflags_env: &str) -> Result, Error> { fn is_flag_prefix(flag: &str) -> bool { [ "-Z", @@ -94,7 +94,7 @@ impl RustcCodegenFlags { (flag, None) }; - fn flag_ok_or(flag: Option<&str>, msg: &'static str) -> Result<&str, Error> { + fn flag_ok_or<'flag>(flag: Option<&'flag str>, msg: &'static str) -> Result<&'flag str, Error> { flag.ok_or(Error::new(ErrorKind::InvalidFlag, msg)) }