macro: clippy fixes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2021-07-02 11:37:51 +02:00
parent 83ac604e08
commit a2a884c13d
2 changed files with 3 additions and 2 deletions

View File

@ -370,6 +370,7 @@ fn handle_return_kind(
};
}
#[allow(clippy::branches_sharing_code)] // ARE YOU SERIOUS?
if attr.raw_return {
let mut rt = TokenStream::new();
for i in 0..count {

View File

@ -157,7 +157,7 @@ static mut LIB_NAME: Option<String> = None;
pub fn get_default_lib_name(why: Span) -> Result<&'static str, syn::Error> {
unsafe {
if let Some(name) = &LIB_NAME {
return Ok(&name);
return Ok(name);
}
}
@ -186,6 +186,6 @@ pub fn get_default_lib_name(why: Span) -> Result<&'static str, syn::Error> {
unsafe {
LIB_NAME = Some(name.replace('-', "_"));
return Ok(&LIB_NAME.as_ref().unwrap());
return Ok(LIB_NAME.as_ref().unwrap());
}
}