Make clippy a bit happier
This commit is contained in:
parent
470f8001a1
commit
65c0c5607e
@ -54,6 +54,7 @@ impl Debug for Image {
|
||||
}
|
||||
|
||||
/// Caches decoded images.
|
||||
#[derive(Default)]
|
||||
pub struct ImageCache {
|
||||
/// Maps from file hashes to ids of decoded images.
|
||||
images: HashMap<ImageId, Image>,
|
||||
@ -64,7 +65,7 @@ pub struct ImageCache {
|
||||
impl ImageCache {
|
||||
/// Create a new, empty image cache.
|
||||
pub fn new() -> Self {
|
||||
Self { images: HashMap::new(), on_load: None }
|
||||
Self::default()
|
||||
}
|
||||
|
||||
/// Load and decode an image file from a path.
|
||||
|
@ -21,7 +21,7 @@ pub struct LayoutCache {
|
||||
impl LayoutCache {
|
||||
/// Create a new, empty layout cache.
|
||||
pub fn new() -> Self {
|
||||
Self { frames: HashMap::new(), age: 0 }
|
||||
Self::default()
|
||||
}
|
||||
|
||||
/// Clear the cache.
|
||||
|
@ -285,7 +285,7 @@ fn split_runs<'a>(
|
||||
range: Range,
|
||||
) -> impl Iterator<Item = (Range, Dir)> + 'a {
|
||||
let mut cursor = range.start;
|
||||
bidi.levels[range.clone()]
|
||||
bidi.levels[range]
|
||||
.group_by_key(|&level| level)
|
||||
.map(move |(level, group)| {
|
||||
let start = cursor;
|
||||
|
@ -235,9 +235,8 @@ fn shape_segment<'a>(
|
||||
}
|
||||
}
|
||||
|
||||
match ctx.cache.font.select(ctx.loader, family, variant) {
|
||||
Some(id) => break (id, true),
|
||||
None => {}
|
||||
if let Some(id) = ctx.cache.font.select(ctx.loader, family, variant) {
|
||||
break (id, true);
|
||||
}
|
||||
}
|
||||
// We're out of families, so we don't do any more fallback and just
|
||||
|
@ -204,7 +204,8 @@ pub fn lang(ctx: &mut EvalContext, args: &mut FuncArgs) -> Value {
|
||||
fn lang_dir(iso: &str) -> Dir {
|
||||
match iso.to_ascii_lowercase().as_str() {
|
||||
"ar" | "he" | "fa" | "ur" | "ps" | "yi" => Dir::RTL,
|
||||
"en" | "fr" | "de" | _ => Dir::LTR,
|
||||
"en" | "fr" | "de" => Dir::LTR,
|
||||
_ => Dir::LTR,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user