Skip to content

Conversation

@CosmicHorrorDev
Copy link
Contributor

Resolves #575

I stuck with OnceLock for the library itself to keep the MSRV bump to just 1.70 instead of 1.80. This did involve refactoring SCOPE_REPO to a function that internally handles initialization to approximate what Lazy does

///
/// Only [`Scope`]s created by the same repository have valid comparison results.
///
/// [`SCOPE_REPO`]: struct.SCOPE_REPO.html
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function should get auto-linked, so I dropped this explicit link, but lmk if that's wrong for some reason

impl core::panic::unwind_safe::UnwindSafe for syntect::parsing::SyntaxSetBuilder
pub const syntect::parsing::ATOM_LEN_BITS: u16 = 3u16
pub static syntect::parsing::SCOPE_REPO: once_cell::sync::Lazy<std::sync::mutex::Mutex<syntect::parsing::ScopeRepository>>
pub fn syntect::parsing::scope_repo() -> &'static std::sync::mutex::Mutex<syntect::parsing::ScopeRepository>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already mentioned in #575, but this is a breaking change 💥

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we need to break semver anyway, it is probably better to completely remove it from the public API? We can always add it back in a minor release if someone depends on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Public dependency on once_cell

3 participants