mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 12:46:49 +00:00
1 parent
3b5607ecdc
commit
ca82b59c6f
11 files changed
+138
-99
No files matched your search
@@ -1,3 +1,18 @@
|
||||
use syn::{Expr, Lit, Meta};
|
||||
|
||||
pub(crate) fn get_named_string(args: &[Meta], name: &str) -> Option<String> {
|
||||
args.iter().find_map(|arg| {
|
||||
let value = arg.require_name_value().ok()?;
|
||||
let Expr::Lit(ref lit) = value.value else {
|
||||
return None;
|
||||
};
|
||||
let Lit::Str(ref str) = lit.lit else {
|
||||
return None;
|
||||
};
|
||||
value.path.is_ident(name).then_some(str.value())
|
||||
})
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub(crate) fn camel_to_snake_string(s: &str) -> String {
|
||||
let mut output = String::with_capacity(
|
||||
|
||||
Reference in new issue
Block a user