Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make static lifetime of constants explicit #170

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub enum Generator {

impl Generator {
/// Tonic include file name
pub const TONIC_INCLUDE_FILE: &str = "buffrs.rs";
pub const TONIC_INCLUDE_FILE: &'static str = "buffrs.rs";

/// Run the generator for a dependency and output files at the provided path
pub async fn run(&self) -> miette::Result<()> {
Expand Down
4 changes: 2 additions & 2 deletions src/package/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ pub struct PackageStore {

impl PackageStore {
/// Path to the proto directory
pub const PROTO_PATH: &str = "proto";
pub const PROTO_PATH: &'static str = "proto";
/// Path to the dependency store
pub const PROTO_VENDOR_PATH: &str = "proto/vendor";
pub const PROTO_VENDOR_PATH: &'static str = "proto/vendor";

fn new(root: PathBuf) -> Self {
Self { root }
Expand Down
4 changes: 2 additions & 2 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ pub struct VirtualFileSystem {
}

impl VirtualFileSystem {
const VIRTUAL_HOME: &str = "$HOME";
const ROOT_NAME: &str = "root";
const VIRTUAL_HOME: &'static str = "$HOME";
const ROOT_NAME: &'static str = "root";

/// Init an empty virtual file system
pub fn empty() -> Self {
Expand Down