-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: It's a little annoying to write all the `cfg` boilerplate again and again. Reviewed By: Acesine Differential Revision: D55648146 fbshipit-source-id: ab30c9714dfd8a40861ee7ec39ef15fa8de04e6d
- Loading branch information
1 parent
2a0a770
commit 50b5cf4
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under both the MIT license found in the | ||
* LICENSE-MIT file in the root directory of this source tree and the Apache | ||
* License, Version 2.0 found in the LICENSE-APACHE file in the root directory | ||
* of this source tree. | ||
*/ | ||
|
||
#[cfg(any(not(fbcode_build), not(target_os = "linux")))] | ||
pub fn check_boolean_knob(name: &str) -> bool { | ||
false | ||
} | ||
|
||
#[cfg(all(fbcode_build, target_os = "linux"))] | ||
pub fn check_boolean_knob(name: &str) -> bool { | ||
justknobs::eval(name, None, None).unwrap_or(false) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters