aboutsummaryrefslogtreecommitdiff
path: root/src/gen/inside.rs
blob: d4160310f4ba06dfa201665d5ec43f719b9e85b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
use crate::customize::Customize;
use crate::gen::rust::path::RustPath;

/// Path to `protobuf` crate, different when `.proto` file is
/// used inside or outside of protobuf crate.
pub(crate) fn protobuf_crate_path(customize: &Customize) -> RustPath {
    match customize.inside_protobuf {
        Some(true) => RustPath::from("crate"),
        _ => RustPath::from("::protobuf"),
    }
}