mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-23 09:19:32 +00:00
3 clippy fixes
This commit is contained in:
parent
eb80f8a1a5
commit
45dfe28aa9
3 changed files with 7 additions and 9 deletions
|
|
@ -9,10 +9,9 @@ fn main() -> Result<(), anyhow::Error> {
|
|||
let manifest_dir = std::env::var_os("CARGO_MANIFEST_DIR").unwrap();
|
||||
|
||||
// Go from $root/api/cpp down to $root
|
||||
let root_dir = Path::new(&manifest_dir).ancestors().nth(2).expect(&format!(
|
||||
"Failed to locate root directory, relative to {}",
|
||||
manifest_dir.to_string_lossy()
|
||||
));
|
||||
let root_dir = Path::new(&manifest_dir).ancestors().nth(2).unwrap_or_else(|| {
|
||||
panic!("Failed to locate root directory, relative to {}", manifest_dir.to_string_lossy())
|
||||
});
|
||||
|
||||
println!("cargo:rerun-if-env-changed=SLINT_GENERATED_INCLUDE_DIR");
|
||||
let output_dir = std::env::var_os("SLINT_GENERATED_INCLUDE_DIR").unwrap_or_else(|| {
|
||||
|
|
|
|||
|
|
@ -247,11 +247,11 @@ pub extern "C" fn slint_open_url(url: &SharedString) {
|
|||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn slint_escape_markdown(text: &mut SharedString) -> &SharedString {
|
||||
*text = i_slint_core::escape_markdown(&text).into();
|
||||
*text = i_slint_core::escape_markdown(text).into();
|
||||
text
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn slint_parse_markdown(text: &SharedString, out: &mut StyledText) {
|
||||
*out = i_slint_core::parse_markdown(&text);
|
||||
*out = i_slint_core::parse_markdown(text);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ use std::rc::Rc;
|
|||
|
||||
pub fn lower_timers(component: &Rc<Component>, diag: &mut BuildDiagnostics) {
|
||||
visit_all_expressions(component, |e, _| {
|
||||
e.visit_recursive_mut(&mut |e| match e {
|
||||
Expression::FunctionCall { function, arguments, .. } => {
|
||||
e.visit_recursive_mut(&mut |e| {
|
||||
if let Expression::FunctionCall { function, arguments, .. } = e {
|
||||
if let Callable::Builtin(BuiltinFunction::StartTimer | BuiltinFunction::StopTimer) =
|
||||
function
|
||||
&& let [Expression::ElementReference(timer)] = arguments.as_slice()
|
||||
|
|
@ -32,7 +32,6 @@ pub fn lower_timers(component: &Rc<Component>, diag: &mut BuildDiagnostics) {
|
|||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue