Skip to content

Commit

Permalink
fix: errors in rust 1.81
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Sep 28, 2024
1 parent af49627 commit 8c46a40
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion crates/conversion/typst2vec/src/incr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl IncrDocServer {

/// Gets element paths by the given span.
///
/// See [`crate::vector::pass::Span2VecPass::query_element_paths`] for more
/// See [`crate::pass::Span2VecPass::query_element_paths`] for more
/// information.
pub fn resolve_element_paths_by_span(
&mut self,
Expand Down
4 changes: 1 addition & 3 deletions crates/conversion/vec2svg/src/frontend/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,11 @@ impl<'m, 't, Feat: ExportFeature> DynExportFeature for RenderContext<'m, 't, Fea

impl<'m, 't, Feat: ExportFeature> FontIndice<'m> for RenderContext<'m, 't, Feat> {
fn get_font(&self, value: &FontRef) -> Option<&'m ir::FontItem> {
self.module.fonts.get(value.idx as usize).map(|e| {
self.module.fonts.get(value.idx as usize).inspect(|e| {
// canary check
if e.hash != value.hash {
panic!("Invalid font reference: {:?}", value);
}

e
})
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/reflexo-typst/src/exporter/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ impl<'a, W: io::Write> AstWriter<'a, W> {
}

fn write_ident(&mut self) {
self.w.write_all(&[b'\n']).unwrap();
self.w.write_all(b"\n").unwrap();
for _i in 0..self.ident {
self.w.write_all(&[b' ']).unwrap();
self.w.write_all(b" ").unwrap();
}
}

Expand Down
11 changes: 6 additions & 5 deletions crates/reflexo-typst/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
//! - `model`: low-level abstraction specific to the compiler, which defines:
//! - [`font::FontSlot`]: the way to load a font.
//! - [`vfs::AccessModel`]: how the compiler accesses a storage.
//! - [`package::Registry`]: how the compiler obtains data about a package.
//! - [`package::PackageRegistry`]: how the compiler obtains data about a
//! package.
//!
//! - [`world`]: The world is the core part of the library, which maintains all
//! the data for typst compilation.
//! - [`vfs::Vfs`]: retrieving [`vfs::AccessModel`], provides a virtual file
//! system for the [`world::CompilerWorld`]
//! - [`world::CompilerWorld`]: retrieving [`world::CompilerFeat`], provides a
//! common implementation of [`typst::World`].
//! common implementation of [`::typst::World`].
//!
//! - [`service`]: Convenient services over [`world::CompilerWorld`], which also
//! - [`compile`]: Convenient services over [`world::CompilerWorld`], which also
//! shows how to use the [`world::CompilerWorld`].
//! - [`service::CompileDriver`]: A driver for the compiler. Examples:
//! - [`CompileDriver`]: A driver for the compiler. Examples:
//! - Single thread (Sync): <https://github.com/Myriad-Dreamin/typst.ts/blob/main/cli/src/main.rs>
//! - Multiple thread (Async): <https://github.com/Enter-tainer/typst-preview-vscode/blob/main/src/main.rs>
Expand Down Expand Up @@ -94,7 +95,7 @@ pub use world::font;
pub use reflexo::time;
/// A vfs implementation for compiler.
pub use reflexo_vfs as vfs;
/// A common implementation of [`typst::World`]
/// A common implementation of [`::typst::World`]
pub use reflexo_world as world;
pub use time::Time;
/// package things about compiler.
Expand Down
2 changes: 1 addition & 1 deletion crates/reflexo-typst/src/task.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Task are stateless actors that staring computing tasks.
//! [`SyncTaskFactory`] can hold *mutable* configuration but the mutations don't
//! `SyncTaskFactory` can hold *mutable* configuration but the mutations don't
//! blocking the computation, i.e. the mutations are non-blocking.
mod cache;
Expand Down
4 changes: 2 additions & 2 deletions crates/reflexo-world/src/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl<'a, F: CompilerFeat> Revising<'a, CompilerUniverse<F>> {

/// Let the vfs notify the access model with a filesystem event.
///
/// See [`NotifyAccessModel`] for more information.
/// See [`reflexo_vfs::NotifyAccessModel`] for more information.
pub fn notify_fs_event(&mut self, event: FilesystemEvent) {
self.inner.vfs.notify_fs_event(event);
}
Expand Down Expand Up @@ -96,7 +96,7 @@ impl<'a, F: CompilerFeat> Revising<'a, CompilerUniverse<F>> {
/// A universe that provides access to the operating system.
///
/// Use [`CompilerUniverse::new`] to create a new universe.
/// Use [`CompilerUniverse::spawn`] to create a new world.
/// Use [`CompilerUniverse::snapshot`] to create a new world.
#[derive(Debug)]
pub struct CompilerUniverse<F: CompilerFeat> {
/// State for the *root & entry* of compilation.
Expand Down

0 comments on commit 8c46a40

Please sign in to comment.