mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 15:51:15 -03:00
feat: make as_os_strs easier to use
Make trailing comma optional. Return array, rather than reference to array, to eliminate lifetime issues. Closes #12688
This commit is contained in:
committed by
Johannes Altmanninger
parent
39bd54cb49
commit
3ad45d8fb1
@@ -98,14 +98,14 @@ pub fn target_os_is_cygwin() -> bool {
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! as_os_strs {
|
||||
[ $( $x:expr, )* ] => {
|
||||
[ $( $x:expr ),* $(,)? ] => {
|
||||
{
|
||||
use std::ffi::OsStr;
|
||||
fn as_os_str<S: AsRef<OsStr> + ?Sized>(s: &S) -> &OsStr {
|
||||
s.as_ref()
|
||||
}
|
||||
&[
|
||||
$( as_os_str($x), )*
|
||||
[
|
||||
$( as_os_str($x) ),*
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user