Skip to content

Commit ecb4f42

Browse files
authored
Auto merge of servo#28720 - s-maurice:move_servo_version_from_config, r=jdm
move servo_version from out of config crate `servo_version`'s contents are moved to `simpleservo::servo_version` in `ports/libsimpleservo/api/src/lib.rs`. `servo_version`'s contents are also duplicated in a new function `servo_version` in `ports/winit/main2.rs`. It's my first PR, I'm not really sure what is required. Let me know what I need to change to make this work. Thanks! Signed-off-by: s-maurice <[email protected]> <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix servo#28719 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because they do not change any logic. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2 parents 66dec13 + 4784564 commit ecb4f42

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

components/config/lib.rs

-9
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,3 @@ pub mod prefs;
1818
pub mod basedir;
1919
#[allow(unsafe_code)]
2020
pub mod opts;
21-
22-
pub fn servo_version() -> String {
23-
let cargo_version = env!("CARGO_PKG_VERSION");
24-
let git_info = option_env!("GIT_INFO");
25-
match git_info {
26-
Some(info) => format!("Servo {}{}", cargo_version, info),
27-
None => format!("Servo {}", cargo_version),
28-
}
29-
}

ports/libsimpleservo/api/src/lib.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,12 @@ pub struct ServoGlue {
185185
}
186186

187187
pub fn servo_version() -> String {
188-
servo::config::servo_version()
188+
let cargo_version = env!("CARGO_PKG_VERSION");
189+
let git_info = option_env!("GIT_INFO");
190+
match git_info {
191+
Some(info) => format!("Servo {}{}", cargo_version, info),
192+
None => format!("Servo {}", cargo_version),
193+
}
189194
}
190195

191196
/// Test if a url is valid.

ports/winit/main2.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ mod window_trait;
2626
use app::App;
2727
use getopts::Options;
2828
use servo::config::opts::{self, ArgumentParsingResult};
29-
use servo::config::servo_version;
3029
use servo::servo_config::pref;
3130
use std::env;
3231
use std::io::Write;
@@ -163,3 +162,12 @@ pub fn main() {
163162

164163
platform::deinit(clean_shutdown)
165164
}
165+
166+
pub fn servo_version() -> String {
167+
let cargo_version = env!("CARGO_PKG_VERSION");
168+
let git_info = option_env!("GIT_INFO");
169+
match git_info {
170+
Some(info) => format!("Servo {}{}", cargo_version, info),
171+
None => format!("Servo {}", cargo_version),
172+
}
173+
}

0 commit comments

Comments
 (0)