From 36c73016086436eb4cda1c61ab8200cafc38a719 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 21 Nov 2023 15:20:49 +0100 Subject: [PATCH] Tidy up some imports --- crates/typst-cli/src/update.rs | 3 ++- crates/typst-ide/src/tooltip.rs | 3 +-- crates/typst-library/src/layout/list.rs | 3 +-- crates/typst-library/src/math/mod.rs | 2 +- crates/typst-library/src/text/linebreak.rs | 3 ++- crates/typst-pdf/src/gradient.rs | 5 ++--- crates/typst-syntax/src/source.rs | 3 +-- crates/typst/src/eval/value.rs | 7 +++---- 8 files changed, 13 insertions(+), 16 deletions(-) diff --git a/crates/typst-cli/src/update.rs b/crates/typst-cli/src/update.rs index e58963399..c94515b64 100644 --- a/crates/typst-cli/src/update.rs +++ b/crates/typst-cli/src/update.rs @@ -6,7 +6,8 @@ use std::path::PathBuf; use semver::Version; use serde::Deserialize; use tempfile::NamedTempFile; -use typst::{diag::bail, diag::StrResult, eval::eco_format}; +use typst::diag::{bail, StrResult}; +use typst::eval::eco_format; use xz2::bufread::XzDecoder; use zip::ZipArchive; diff --git a/crates/typst-ide/src/tooltip.rs b/crates/typst-ide/src/tooltip.rs index 87b383d5e..d3f040e72 100644 --- a/crates/typst-ide/src/tooltip.rs +++ b/crates/typst-ide/src/tooltip.rs @@ -5,8 +5,7 @@ use if_chain::if_chain; use typst::doc::Frame; use typst::eval::{repr, CapturesVisitor, CastInfo, Repr, Tracer, Value}; use typst::geom::{round_2, Length, Numeric}; -use typst::syntax::ast; -use typst::syntax::{LinkedNode, Source, SyntaxKind}; +use typst::syntax::{ast, LinkedNode, Source, SyntaxKind}; use typst::World; use crate::analyze::analyze_labels; diff --git a/crates/typst-library/src/layout/list.rs b/crates/typst-library/src/layout/list.rs index e30aa975d..7c089760e 100644 --- a/crates/typst-library/src/layout/list.rs +++ b/crates/typst-library/src/layout/list.rs @@ -1,5 +1,4 @@ -use crate::layout::GridLayouter; -use crate::layout::{BlockElem, ParElem, Sizing, Spacing}; +use crate::layout::{BlockElem, GridLayouter, ParElem, Sizing, Spacing}; use crate::prelude::*; use crate::text::TextElem; diff --git a/crates/typst-library/src/math/mod.rs b/crates/typst-library/src/math/mod.rs index 81bdd0fc9..7ced638b2 100644 --- a/crates/typst-library/src/math/mod.rs +++ b/crates/typst-library/src/math/mod.rs @@ -46,9 +46,9 @@ use self::fragment::*; use self::row::*; use self::spacing::*; use crate::layout::{AlignElem, BoxElem, HElem, ParElem, Spacing}; -use crate::meta::Supplement; use crate::meta::{ Count, Counter, CounterUpdate, LocalNameIn, Numbering, Outlinable, Refable, + Supplement, }; use crate::prelude::*; use crate::shared::BehavedBuilder; diff --git a/crates/typst-library/src/text/linebreak.rs b/crates/typst-library/src/text/linebreak.rs index 5602d9cce..8a69e0a84 100644 --- a/crates/typst-library/src/text/linebreak.rs +++ b/crates/typst-library/src/text/linebreak.rs @@ -1,4 +1,5 @@ -use icu_properties::{maps::CodePointMapData, LineBreak}; +use icu_properties::maps::CodePointMapData; +use icu_properties::LineBreak; use icu_provider::AsDeserializingBufferProvider; use icu_provider_adapters::fork::ForkByKeyProvider; use icu_provider_blob::BlobDataProvider; diff --git a/crates/typst-pdf/src/gradient.rs b/crates/typst-pdf/src/gradient.rs index 3d5084155..ecb01ee6b 100644 --- a/crates/typst-pdf/src/gradient.rs +++ b/crates/typst-pdf/src/gradient.rs @@ -2,10 +2,9 @@ use std::f32::consts::{PI, TAU}; use std::sync::Arc; use ecow::{eco_format, EcoString}; -use pdf_writer::types::FunctionShadingType; +use pdf_writer::types::{ColorSpaceOperand, FunctionShadingType}; use pdf_writer::writers::StreamShadingType; -use pdf_writer::{types::ColorSpaceOperand, Name}; -use pdf_writer::{Filter, Finish, Ref}; +use pdf_writer::{Filter, Finish, Name, Ref}; use typst::geom::{ Abs, Angle, Color, ColorSpace, ConicGradient, Gradient, Numeric, Point, Quadrant, Ratio, Relative, Transform, WeightedColor, diff --git a/crates/typst-syntax/src/source.rs b/crates/typst-syntax/src/source.rs index 4bf4045aa..3631a2ea7 100644 --- a/crates/typst-syntax/src/source.rs +++ b/crates/typst-syntax/src/source.rs @@ -8,8 +8,7 @@ use std::sync::Arc; use comemo::Prehashed; use crate::reparser::reparse; -use crate::VirtualPath; -use crate::{is_newline, parse, FileId, LinkedNode, Span, SyntaxNode}; +use crate::{is_newline, parse, FileId, LinkedNode, Span, SyntaxNode, VirtualPath}; /// A source file. /// diff --git a/crates/typst/src/eval/value.rs b/crates/typst/src/eval/value.rs index baf18aa00..b88a293e6 100644 --- a/crates/typst/src/eval/value.rs +++ b/crates/typst/src/eval/value.rs @@ -12,11 +12,10 @@ use siphasher::sip128::{Hasher128, SipHasher13}; use crate::diag::StrResult; use crate::eval::{ - fields, ops, repr, Args, Array, AutoValue, Bytes, CastInfo, Content, Dict, Duration, - FromValue, Func, IntoValue, Module, NativeType, NoneValue, Plugin, Reflect, Repr, - Scope, Str, Symbol, Type, Version, + fields, item, ops, repr, Args, Array, AutoValue, Bytes, CastInfo, Content, Datetime, + Dict, Duration, FromValue, Func, IntoValue, Module, NativeType, NoneValue, Plugin, + Reflect, Repr, Scope, Str, Symbol, Type, Version, }; -use crate::eval::{item, Datetime}; use crate::geom::{Abs, Angle, Color, Em, Fr, Gradient, Length, Ratio, Rel}; use crate::model::{Label, Styles}; use crate::syntax::{ast, Span};