below_common/
lib.rs

1// Copyright (c) Facebook, Inc. and its affiliates.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#![deny(clippy::all)]
16
17pub mod cliutil;
18pub mod dateutil;
19pub mod fileutil;
20pub mod logutil;
21pub mod util;
22
23// Shim between facebook types and open source types.
24//
25// The type interfaces and module hierarchy should be identical on
26// both "branches". And since we glob import, all the submodules in
27// this crate will inherit our name bindings and can use generic paths,
28// eg `crate::logging::setup(..)`.
29#[macro_export]
30macro_rules! open_source_shim {
31    ($v:vis) => {
32        #[cfg(fbcode_build)]
33        mod facebook;
34        #[cfg(fbcode_build)]
35        $v use facebook::*;
36        #[cfg(not(fbcode_build))]
37        mod open_source;
38        #[cfg(not(fbcode_build))]
39        $v use open_source::*;
40    };
41    () => {
42        open_source_shim!(pub(self));
43    };
44}