mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-23 20:56:42 +00:00
feat: bump edition of most crates to rust 2024 (#2042)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This commit is contained in:
parent
d227ad2a53
commit
05280aec4d
128 changed files with 340 additions and 331 deletions
|
|
@ -5,8 +5,8 @@ use tinymist_std::{bail, error::prelude::Result};
|
|||
|
||||
pub use tinymist_world::args::{CompileFontArgs, CompilePackageArgs};
|
||||
|
||||
use crate::model::*;
|
||||
use crate::PROJECT_ROUTE_USER_ACTION_PRIORITY;
|
||||
use crate::model::*;
|
||||
|
||||
/// Project document commands.
|
||||
#[derive(Debug, Clone, clap::Subcommand)]
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ use std::collections::HashSet;
|
|||
use std::path::Path;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
|
||||
use ecow::{eco_vec, EcoVec};
|
||||
use ecow::{EcoVec, eco_vec};
|
||||
use tinymist_std::error::prelude::Result;
|
||||
use tinymist_std::{typst::TypstDocument, ImmutPath};
|
||||
use tinymist_std::{ImmutPath, typst::TypstDocument};
|
||||
use tinymist_task::ExportTarget;
|
||||
use tinymist_world::vfs::notify::{
|
||||
FilesystemEvent, MemoryEvent, NotifyDeps, NotifyMessage, UpstreamUpdateEvent,
|
||||
|
|
@ -190,7 +190,7 @@ impl fmt::Display for CompileReportMsg<'_> {
|
|||
Suspend => return f.write_str("suspended"),
|
||||
Compiling => return f.write_str("compiling"),
|
||||
CompileSuccess(Res { diag: 0, elapsed }) => {
|
||||
return write!(f, "{input:?}: compilation succeeded in {elapsed:?}")
|
||||
return write!(f, "{input:?}: compilation succeeded in {elapsed:?}");
|
||||
}
|
||||
CompileSuccess(res) => ("compilation succeeded", res),
|
||||
CompileError(res) => ("compilation failed", res),
|
||||
|
|
@ -808,7 +808,7 @@ impl<F: CompilerFeat, Ext: 'static> ProjectInsState<F, Ext> {
|
|||
pub fn may_compile(
|
||||
&mut self,
|
||||
handler: &Arc<dyn CompileHandler<F, Ext>>,
|
||||
) -> Option<impl FnOnce() -> CompiledArtifact<F>> {
|
||||
) -> Option<impl FnOnce() -> CompiledArtifact<F> + 'static> {
|
||||
if !self.reason.any() || self.verse.entry_state().is_inactive() {
|
||||
return None;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ use std::sync::Arc;
|
|||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tinymist_l10n::DebugL10n;
|
||||
use tinymist_std::ImmutPath;
|
||||
use tinymist_std::error::prelude::*;
|
||||
use tinymist_std::hash::FxDashMap;
|
||||
use tinymist_std::ImmutPath;
|
||||
use tinymist_world::EntryState;
|
||||
use typst::syntax::VirtualPath;
|
||||
|
||||
|
|
@ -131,7 +131,9 @@ impl EntryResolver {
|
|||
Some(VirtualPath::new(stripped)),
|
||||
)),
|
||||
Err(err) => {
|
||||
log::info!("Entry is not in root directory: err {err:?}: entry: {entry:?}, root: {root:?}");
|
||||
log::info!(
|
||||
"Entry is not in root directory: err {err:?}: entry: {entry:?}, root: {root:?}"
|
||||
);
|
||||
EntryState::new_rooted_by_parent(entry)
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,16 +4,16 @@ use std::cmp::Ordering;
|
|||
use std::io::{Read, Seek, SeekFrom, Write};
|
||||
use std::{path::Path, sync::Arc};
|
||||
|
||||
use ecow::{eco_vec, EcoVec};
|
||||
use ecow::{EcoVec, eco_vec};
|
||||
use tinymist_std::error::prelude::*;
|
||||
use tinymist_std::path::unix_slash;
|
||||
use tinymist_std::{bail, ImmutPath};
|
||||
use tinymist_std::{ImmutPath, bail};
|
||||
use tinymist_task::CtxPath;
|
||||
use typst::diag::EcoString;
|
||||
use typst::World;
|
||||
use typst::diag::EcoString;
|
||||
|
||||
use crate::model::{ApplyProjectTask, Id, ProjectInput, ProjectRoute, ResourcePath};
|
||||
use crate::{LockFile, LockFileCompat, LspWorld, ProjectPathMaterial, LOCK_FILENAME, LOCK_VERSION};
|
||||
use crate::{LOCK_FILENAME, LOCK_VERSION, LockFile, LockFileCompat, LspWorld, ProjectPathMaterial};
|
||||
|
||||
impl LockFile {
|
||||
pub fn get_document(&self, id: &Id) -> Option<&ProjectInput> {
|
||||
|
|
@ -169,13 +169,13 @@ impl LockFile {
|
|||
Some(Ordering::Equal | Ordering::Less) => {}
|
||||
Some(Ordering::Greater) => {
|
||||
bail!(
|
||||
"trying to update lock file having a future version, current tinymist-cli supports {LOCK_VERSION}, the lock file is {version}",
|
||||
);
|
||||
"trying to update lock file having a future version, current tinymist-cli supports {LOCK_VERSION}, the lock file is {version}",
|
||||
);
|
||||
}
|
||||
None => {
|
||||
bail!(
|
||||
"cannot compare version, are version strings in right format? current tinymist-cli supports {LOCK_VERSION}, the lock file is {version}",
|
||||
);
|
||||
"cannot compare version, are version strings in right format? current tinymist-cli supports {LOCK_VERSION}, the lock file is {version}",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
|
||||
use tinymist_std::error::prelude::*;
|
||||
use tinymist_std::ImmutPath;
|
||||
use tinymist_std::error::prelude::*;
|
||||
use tinymist_task::ExportTarget;
|
||||
use tinymist_world::package::RegistryPathMapper;
|
||||
use tinymist_world::vfs::Vfs;
|
||||
use tinymist_world::{args::*, WorldComputeGraph};
|
||||
use tinymist_world::{
|
||||
CompileSnapshot, CompilerFeat, CompilerUniverse, CompilerWorld, EntryOpts, EntryState,
|
||||
};
|
||||
use tinymist_world::{WorldComputeGraph, args::*};
|
||||
use typst::Features;
|
||||
use typst::diag::FileResult;
|
||||
use typst::foundations::{Bytes, Dict};
|
||||
use typst::utils::LazyHash;
|
||||
use typst::Features;
|
||||
|
||||
use crate::world::font::FontResolverImpl;
|
||||
use crate::{CompiledArtifact, Interrupt};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use std::path::{Path, PathBuf};
|
|||
|
||||
use ecow::EcoVec;
|
||||
use tinymist_std::error::prelude::*;
|
||||
use tinymist_std::{bail, ImmutPath};
|
||||
use tinymist_std::{ImmutPath, bail};
|
||||
use typst::diag::EcoString;
|
||||
|
||||
pub use task::*;
|
||||
|
|
|
|||
|
|
@ -12,15 +12,15 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use notify::{Config, RecommendedWatcher, RecursiveMode, Watcher};
|
||||
use tinymist_std::{error::IgnoreLogging, ImmutPath};
|
||||
use tinymist_std::{ImmutPath, error::IgnoreLogging};
|
||||
use tinymist_world::vfs::notify::NotifyDeps;
|
||||
use tokio::sync::mpsc;
|
||||
use typst::diag::FileError;
|
||||
|
||||
use tinymist_world::vfs::{
|
||||
FileChangeSet, FileSnapshot, PathAccessModel,
|
||||
notify::{FilesystemEvent, NotifyMessage, UpstreamUpdateEvent},
|
||||
system::SystemAccessModel,
|
||||
FileChangeSet, FileSnapshot, PathAccessModel,
|
||||
};
|
||||
|
||||
type WatcherPair = (RecommendedWatcher, mpsc::UnboundedReceiver<NotifyEvent>);
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@ pub use tinymist_world as base;
|
|||
pub use tinymist_world::args::*;
|
||||
pub use tinymist_world::config::CompileFontOpts;
|
||||
pub use tinymist_world::entry::*;
|
||||
pub use tinymist_world::{diag, font, package, vfs};
|
||||
pub use tinymist_world::{
|
||||
with_main, CompilerUniverse, CompilerWorld, DiagnosticFormat, EntryOpts, EntryState,
|
||||
RevisingUniverse, SourceWorld, TaskInputs,
|
||||
CompilerUniverse, CompilerWorld, DiagnosticFormat, EntryOpts, EntryState, RevisingUniverse,
|
||||
SourceWorld, TaskInputs, with_main,
|
||||
};
|
||||
pub use tinymist_world::{diag, font, package, vfs};
|
||||
|
||||
#[cfg(feature = "system")]
|
||||
pub use tinymist_world::system;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue