mirror of
https://github.com/typst/typst
synced 2025-05-19 11:35:27 +08:00
Clippy fixes (#856)
This commit is contained in:
parent
2135027219
commit
56673bcdf5
@ -467,7 +467,7 @@ pub fn perm(
|
|||||||
numbers: u64,
|
numbers: u64,
|
||||||
) -> Value {
|
) -> Value {
|
||||||
// By convention.
|
// By convention.
|
||||||
if base + 1 <= numbers {
|
if base < numbers {
|
||||||
return Ok(Value::Int(0));
|
return Ok(Value::Int(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -506,6 +506,7 @@ impl<'a> Line<'a> {
|
|||||||
|
|
||||||
/// Collect all text of the paragraph into one string. This also performs
|
/// Collect all text of the paragraph into one string. This also performs
|
||||||
/// string-level preprocessing like case transformations.
|
/// string-level preprocessing like case transformations.
|
||||||
|
#[allow(clippy::type_complexity)]
|
||||||
fn collect<'a>(
|
fn collect<'a>(
|
||||||
children: &'a [Content],
|
children: &'a [Content],
|
||||||
styles: &'a StyleChain<'a>,
|
styles: &'a StyleChain<'a>,
|
||||||
@ -715,7 +716,7 @@ fn shape_range<'a>(
|
|||||||
let mut cursor = range.start;
|
let mut cursor = range.start;
|
||||||
|
|
||||||
// Group by embedding level and script.
|
// Group by embedding level and script.
|
||||||
for i in cursor..range.end {
|
for i in range.clone() {
|
||||||
if !bidi.text.is_char_boundary(i) {
|
if !bidi.text.is_char_boundary(i) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#![allow(clippy::wildcard_in_or_patterns)]
|
#![allow(clippy::wildcard_in_or_patterns)]
|
||||||
|
#![allow(clippy::comparison_chain)]
|
||||||
//! Typst's standard library.
|
//! Typst's standard library.
|
||||||
|
|
||||||
pub mod compute;
|
pub mod compute;
|
||||||
|
@ -1203,7 +1203,7 @@ impl ast::Pattern {
|
|||||||
return None;
|
return None;
|
||||||
};
|
};
|
||||||
if let Some(ident) = ident {
|
if let Some(ident) = ident {
|
||||||
vm.define(ident.clone(), sink);
|
vm.define(ident, sink);
|
||||||
}
|
}
|
||||||
i += sink_size as i64;
|
i += sink_size as i64;
|
||||||
Some(())
|
Some(())
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#![allow(clippy::comparison_chain)]
|
||||||
//! The compiler for the _Typst_ markup language.
|
//! The compiler for the _Typst_ markup language.
|
||||||
//!
|
//!
|
||||||
//! # Steps
|
//! # Steps
|
||||||
|
@ -1625,7 +1625,7 @@ impl Destructuring {
|
|||||||
|
|
||||||
// Returns a list of all identifiers in the pattern.
|
// Returns a list of all identifiers in the pattern.
|
||||||
pub fn idents(&self) -> impl Iterator<Item = Ident> + '_ {
|
pub fn idents(&self) -> impl Iterator<Item = Ident> + '_ {
|
||||||
self.bindings().into_iter().filter_map(|binding| match binding {
|
self.bindings().filter_map(|binding| match binding {
|
||||||
DestructuringKind::Ident(ident) => Some(ident),
|
DestructuringKind::Ident(ident) => Some(ident),
|
||||||
DestructuringKind::Sink(ident) => ident,
|
DestructuringKind::Sink(ident) => ident,
|
||||||
DestructuringKind::Named(_, ident) => Some(ident),
|
DestructuringKind::Named(_, ident) => Some(ident),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user