-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Description
Hi, I spent a bit of time looking through Anki's source code and realized that there were many excerpts that check for the operating system that Anki is being currently run on, e.g.:
Line 291 in 9679923
| if cfg!(target_os = "macos") { |
In many cases, like the one linked above, such checks can be done at compile-time and don't have to take place during the runtime, for example see here:
Line 187 in 9679923
| #[cfg(target_os = "macos")] |
There are a couple of cases where this turns up: https://github.com/search?q=repo%3Aankitects%2Fanki+cfg%21%28target_&type=code
The if-else cases can be substituted e.g. with #[cfg(not(target_os = "macos"))] or similar.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels