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

Fix Android compilation errors #124

Closed
wants to merge 0 commits into from
Closed

Conversation

agougougoua
Copy link
Contributor

No description provided.

src/config.rs Outdated
@@ -9,6 +10,19 @@ use webrtc::{
Error,
};

#[cfg(target_os = "android")]
fn get_local_ip_address() -> Option<String> {
// 对于Android平台,直接返回None或者一个固定的IP地址
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment should use English

src/config.rs Outdated

#[cfg(not(target_os = "android"))]
fn get_local_ip_address() -> Option<String> {
// 在支持的平台上使用local_ip_address包获取IP地址,并将IpAddr转换为String
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use English

src/config.rs Outdated
@@ -152,11 +166,12 @@ fn default_http_listen() -> String {
fn default_registry_ip_port() -> String {
format!(
"{}:{}",
local_ip().unwrap(),
get_local_ip_address().unwrap_or_else(|| "127.0.0.1".to_string()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use method unwrap_or

src/config.rs Outdated
env::var("PORT").unwrap_or(String::from("7777"))
)
}


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this blank line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants