-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
@@ -97,6 +99,19 @@ fn read_manifest(name: &str, mut path: PathBuf) -> EndpointInfo { | |||
}) | |||
} | |||
|
|||
pub fn local_endpoint(path: String, signer_address: Option<(String, u16)>) -> Option<(String, Box<LocalPageEndpoint>)> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should accept path: PathBuf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe even local_endpoint<P: AsRef<Path>>(path: P, ...) { ... }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -97,9 +99,22 @@ fn read_manifest(name: &str, mut path: PathBuf) -> EndpointInfo { | |||
}) | |||
} | |||
|
|||
pub fn local_endpoints(dapps_path: String, signer_address: Option<(String, u16)>) -> Endpoints { | |||
pub fn local_endpoint<P: AsRef<Path>>(path: P, signer_address: Option<(String, u16)>) -> Option<(String, Box<LocalPageEndpoint>)> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to have short doc comments for non-trivial functions, even if they're non-visible outside their crates.
if let Some((id, endpoint)) = fs::local_endpoint(path.clone(), signer_address.clone()) { | ||
pages.insert(id, endpoint); | ||
} else { | ||
warn!(target: "dapps", "Ingoring invalid dapp at {}", path.display()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*Ignoring
typo and suggestion. |
Closes #4031