cosmic-text icon indicating copy to clipboard operation
cosmic-text copied to clipboard

Remove `Mutex` from `FontSystem`, and make methods take `&mut self`

Open ids1024 opened this issue 1 year ago • 0 comments

Types wrapping &FontSystem instead need to have methods taking an &mut FontSystem. Eliminating the lifetime bounds make the API more usable, but perhaps too many methods require this to be passed.

Moving interior mutability to the caller means it isn't used unless needed, and the caller can use a Mutex, some nostd alternative, or a RefCell.

This updates the editor-orbclient to compile with the API changes. The others need to be updated, but perhaps not until any changes to make methods not require an &mut FontSystem if possible.

ids1024 avatar Nov 08 '22 18:11 ids1024