Skip to content
This repository has been archived by the owner on Jan 26, 2025. It is now read-only.

Commit

Permalink
chore(all): Small formatting and documentation fixes
Browse files Browse the repository at this point in the history
- Fixed some imports
- Fixed some error messages
- Removed requirement for `--raster` on `--ppi`
  • Loading branch information
tingerrr committed Aug 8, 2024
1 parent 9d94ee2 commit edcff00
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
10 changes: 2 additions & 8 deletions crates/typst-test-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,7 @@ pub struct ExportArgs {
pub pdf: bool,

/// The pixel per inch to use for raster export
#[arg(
long,
visible_alias = "ppi",
requires = "raster",
default_value_t = 144.0,
global = true
)]
#[arg(long, visible_alias = "ppi", default_value_t = 144.0, global = true)]
pub pixel_per_inch: f32,
}

Expand All @@ -510,7 +504,7 @@ impl Configure for ExportArgs {
if self.pdf || self.svg {
ctx.operation_failure(|r| {
r.ui()
.error_with(|w| writeln!(w, "PDF and SVGF export are not yet supported"))
.error_with(|w| writeln!(w, "PDF and SVG export are not yet supported"))
})?;
anyhow::bail!("Unsupported export mode used");
}
Expand Down
3 changes: 1 addition & 2 deletions crates/typst-test-lib/src/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ pub mod visual;
/// and comparing visually.
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Strategy {
/// Use visual comparison of raster images, with the given render strategy
/// if necessary.
/// Use visual comparison of raster images.
Visual(visual::Strategy),
}

Expand Down
6 changes: 3 additions & 3 deletions crates/typst-test-lib/src/store/vcs.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
//! Version control support. Contains a default git implementation.
use std::fmt::{Debug, Display};
use std::fs;
use std::fs::File;
use std::io;
use std::io::{BufRead, BufReader, Read, Write};
use std::path::{Path, PathBuf};
use std::{fs, io};

use super::project::{Resolver, TestTarget};
use crate::test::id::Identifier;
Expand Down Expand Up @@ -159,7 +158,8 @@ impl Vcs for Git {
#[cfg(test)]
mod tests {
use super::*;
use crate::{_dev, store::project::v1::ResolverV1};
use crate::_dev;
use crate::store::project::v1::ResolverV1;

#[test]
fn test_git_ignore_dir_non_existent() {
Expand Down
8 changes: 4 additions & 4 deletions crates/typst-test-lib/src/test_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ pub static BUILTIN_TESTSETS: Lazy<TestSets> = Lazy::new(TestSets::default);

/// Builtin test set constructors.
pub mod builtin {
use super::*;

use eval::{
AllTestSet, CustomTestSet, FnTestSet, IdentifierPattern, IdentifierTarget,
IdentifierTestSet, IgnoredTestSet, KindTestSet, NoneTestSet,
};

use super::*;

/// Returns the `none` test set.
pub fn none() -> DynTestSet {
Arc::new(NoneTestSet)
Expand Down Expand Up @@ -359,11 +359,11 @@ pub mod builtin {

/// Test set expression builders.
pub mod expr {
use super::*;

use eval::{BinaryTestSet, UnaryTestSet};
use parsing::{Atom, BinaryExpr, BinaryOp, Expr, Function, UnaryExpr, UnaryOp, Value};

use super::*;

/// Creates the omplement `!a`.
pub fn complement(a: DynTestSet) -> DynTestSet {
Arc::new(UnaryTestSet::Complement(a))
Expand Down

0 comments on commit edcff00

Please sign in to comment.