Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • R rusttype
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 22
    • Issues 22
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • redox-os
  • rusttype
  • Merge requests
  • !158

Glyph lifetimes for Font::glyphs_for & Font::layout

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Vitaliy requested to merge kuviman/rusttype:layout-lifetimes into master Jul 10, 2020
  • Overview 4
  • Commits 3
  • Pipelines 1
  • Changes 3

Currently using Cache<'static> with Font<'static> is only really possible without using Font::glyphs_for or Font::layout, only with Font::glyph.

This is because &'a Font::<'font>::glyph() creates a glyph that only references 'font, but these two methods currently produce glyphs which reference 'a.

This merge request fixes this issue. I have made a slight change in gpu_cache::test::cache_test (only changed lifetime on Cache from '_ to 'static) to demonstrate this. The test was not working before, but is working now.

Also fixed the error in documentation on the layout method - current code did not change the state of the scanning iterator.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: layout-lifetimes