mirror of
https://github.com/lifegpc/pixiv_downloader.git
synced 2026-06-06 05:49:01 +08:00
Format the code
This commit is contained in:
28
build.rs
28
build.rs
@@ -28,14 +28,17 @@ fn main() {
|
|||||||
create_dir(&utils_build_path).unwrap();
|
create_dir(&utils_build_path).unwrap();
|
||||||
}
|
}
|
||||||
let mut config = cmake::Config::new("utils");
|
let mut config = cmake::Config::new("utils");
|
||||||
config.define("CMAKE_INSTALL_PREFIX", out_path.to_str().unwrap())
|
config
|
||||||
|
.define("CMAKE_INSTALL_PREFIX", out_path.to_str().unwrap())
|
||||||
.out_dir(utils_build_path)
|
.out_dir(utils_build_path)
|
||||||
.define("ENABLE_ICONV", "OFF")
|
.define("ENABLE_ICONV", "OFF")
|
||||||
.define("ENABLE_STANDALONE", "ON")
|
.define("ENABLE_STANDALONE", "ON")
|
||||||
.define("ENABLE_CXX17", "ON")
|
.define("ENABLE_CXX17", "ON")
|
||||||
.define("INSTALL_DEP_FILES", "ON");
|
.define("INSTALL_DEP_FILES", "ON");
|
||||||
#[cfg(all(windows, target_env = "msvc"))]
|
#[cfg(all(windows, target_env = "msvc"))]
|
||||||
config.define("CMAKE_BUILD_TYPE", "Release").generator("Ninja");
|
config
|
||||||
|
.define("CMAKE_BUILD_TYPE", "Release")
|
||||||
|
.generator("Ninja");
|
||||||
config.build();
|
config.build();
|
||||||
let dep_path = out_path.join("utils_dep.txt");
|
let dep_path = out_path.join("utils_dep.txt");
|
||||||
let mut f = File::open(dep_path).unwrap();
|
let mut f = File::open(dep_path).unwrap();
|
||||||
@@ -65,10 +68,13 @@ fn main() {
|
|||||||
create_dir(&avdict_build_path).unwrap();
|
create_dir(&avdict_build_path).unwrap();
|
||||||
}
|
}
|
||||||
let mut config = cmake::Config::new("avdict");
|
let mut config = cmake::Config::new("avdict");
|
||||||
config.define("CMAKE_INSTALL_PREFIX", out_path.to_str().unwrap())
|
config
|
||||||
|
.define("CMAKE_INSTALL_PREFIX", out_path.to_str().unwrap())
|
||||||
.out_dir(avdict_build_path);
|
.out_dir(avdict_build_path);
|
||||||
#[cfg(all(windows, target_env = "msvc"))]
|
#[cfg(all(windows, target_env = "msvc"))]
|
||||||
config.define("CMAKE_BUILD_TYPE", "Release").generator("Ninja");
|
config
|
||||||
|
.define("CMAKE_BUILD_TYPE", "Release")
|
||||||
|
.generator("Ninja");
|
||||||
config.build();
|
config.build();
|
||||||
println!("cargo:rustc-link-search=native={}/lib", out_path.display());
|
println!("cargo:rustc-link-search=native={}/lib", out_path.display());
|
||||||
let dep_path = out_path.join("avdict_dep.txt");
|
let dep_path = out_path.join("avdict_dep.txt");
|
||||||
@@ -113,11 +119,14 @@ fn main() {
|
|||||||
create_dir(&exif_build_path).unwrap();
|
create_dir(&exif_build_path).unwrap();
|
||||||
}
|
}
|
||||||
let mut config = cmake::Config::new("exif");
|
let mut config = cmake::Config::new("exif");
|
||||||
config.define("CMAKE_INSTALL_PREFIX", out_path.to_str().unwrap())
|
config
|
||||||
|
.define("CMAKE_INSTALL_PREFIX", out_path.to_str().unwrap())
|
||||||
.out_dir(exif_build_path)
|
.out_dir(exif_build_path)
|
||||||
.define("UTILS_LIBRARY", utils_build_path.to_str().unwrap());
|
.define("UTILS_LIBRARY", utils_build_path.to_str().unwrap());
|
||||||
#[cfg(all(windows, target_env = "msvc"))]
|
#[cfg(all(windows, target_env = "msvc"))]
|
||||||
config.define("CMAKE_BUILD_TYPE", "Release").generator("Ninja");
|
config
|
||||||
|
.define("CMAKE_BUILD_TYPE", "Release")
|
||||||
|
.generator("Ninja");
|
||||||
config.build();
|
config.build();
|
||||||
println!("cargo:rustc-link-search=native={}/lib", out_path.display());
|
println!("cargo:rustc-link-search=native={}/lib", out_path.display());
|
||||||
let dep_path = out_path.join("exif_dep.txt");
|
let dep_path = out_path.join("exif_dep.txt");
|
||||||
@@ -163,11 +172,14 @@ fn main() {
|
|||||||
create_dir(&ugoira_build_path).unwrap();
|
create_dir(&ugoira_build_path).unwrap();
|
||||||
}
|
}
|
||||||
let mut config = cmake::Config::new("ugoira");
|
let mut config = cmake::Config::new("ugoira");
|
||||||
config.define("CMAKE_INSTALL_PREFIX", out_path.to_str().unwrap())
|
config
|
||||||
|
.define("CMAKE_INSTALL_PREFIX", out_path.to_str().unwrap())
|
||||||
.out_dir(ugoira_build_path)
|
.out_dir(ugoira_build_path)
|
||||||
.define("UTILS_LIBRARY", utils_build_path.to_str().unwrap());
|
.define("UTILS_LIBRARY", utils_build_path.to_str().unwrap());
|
||||||
#[cfg(all(windows, target_env = "msvc"))]
|
#[cfg(all(windows, target_env = "msvc"))]
|
||||||
config.define("CMAKE_BUILD_TYPE", "Release").generator("Ninja");
|
config
|
||||||
|
.define("CMAKE_BUILD_TYPE", "Release")
|
||||||
|
.generator("Ninja");
|
||||||
config.build();
|
config.build();
|
||||||
println!("cargo:rustc-link-search=native={}/lib", out_path.display());
|
println!("cargo:rustc-link-search=native={}/lib", out_path.display());
|
||||||
let dep_path = out_path.join("ugoira_dep.txt");
|
let dep_path = out_path.join("ugoira_dep.txt");
|
||||||
|
|||||||
3
rustfmt.toml
Normal file
3
rustfmt.toml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ignore = [
|
||||||
|
"src/settings_list.rs",
|
||||||
|
]
|
||||||
@@ -18,10 +18,7 @@ pub trait ExifDataSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<T: ExifDataSource> ExifDataSource for std::sync::Arc<T> {
|
impl<T: ExifDataSource> ExifDataSource for std::sync::Arc<T> {
|
||||||
call_parent_data_source_fun!(
|
call_parent_data_source_fun!("src/data/exif_data_source.json", **self,);
|
||||||
"src/data/exif_data_source.json",
|
|
||||||
**self,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: ExifDataSource> ExifDataSource for Option<T> {
|
impl<T: ExifDataSource> ExifDataSource for Option<T> {
|
||||||
|
|||||||
@@ -191,7 +191,10 @@ impl Debug for FanboxArticleUrlEmbedMap {
|
|||||||
fanbox_api_test!(test_html_card, {
|
fanbox_api_test!(test_html_card, {
|
||||||
match client.get_post_info(4135937).await {
|
match client.get_post_info(4135937).await {
|
||||||
Some(post) => {
|
Some(post) => {
|
||||||
assert_eq!(post.title(), Some("第255話 夏の新刊入稿しました!ジュエハキャラバンの話"));
|
assert_eq!(
|
||||||
|
post.title(),
|
||||||
|
Some("第255話 夏の新刊入稿しました!ジュエハキャラバンの話")
|
||||||
|
);
|
||||||
assert_eq!(post.creator_id(), Some("shiratamaco"));
|
assert_eq!(post.creator_id(), Some("shiratamaco"));
|
||||||
println!("{:#?}", post);
|
println!("{:#?}", post);
|
||||||
match post.check_unknown() {
|
match post.check_unknown() {
|
||||||
|
|||||||
Reference in New Issue
Block a user