diff options
Diffstat (limited to 'src/gen/inside.rs')
-rw-r--r-- | src/gen/inside.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gen/inside.rs b/src/gen/inside.rs new file mode 100644 index 0000000..d416031 --- /dev/null +++ b/src/gen/inside.rs @@ -0,0 +1,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"), + } +} |