build: 清理代码并且升级依赖。
This commit is contained in:
@ -140,7 +140,6 @@ impl CoreManager {
|
||||
tokio::spawn(async move {
|
||||
let mut global_sub_pixels = HashMap::new();
|
||||
while let Some(screenshot) = rx.recv().await {
|
||||
let start_at = Instant::now();
|
||||
let colors = screenshot.get_colors();
|
||||
let config = screenshot.get_config();
|
||||
for (colors, config) in vec![
|
||||
|
@ -115,7 +115,6 @@ mod tests {
|
||||
async fn write_config_to_disk_should_be_successful() {
|
||||
let temp = TestDir::temp().create("config_dir", test_dir::FileType::Dir);
|
||||
let config_file_path = temp.path("config_dir").join("picker.config.json");
|
||||
let manager = crate::picker::config::manger::Manager::default();
|
||||
crate::picker::config::manger::Manager::write_config_to_disk(
|
||||
config_file_path.clone(),
|
||||
&Configuration::default(),
|
||||
|
@ -9,10 +9,6 @@ pub struct DisplayPicker {
|
||||
}
|
||||
|
||||
impl DisplayPicker {
|
||||
pub fn new(screen: Screen, config: DisplayConfig) -> Self {
|
||||
Self { screen, config }
|
||||
}
|
||||
|
||||
pub fn from_config(config: DisplayConfig) -> anyhow::Result<Self> {
|
||||
let displays = Display::all()
|
||||
.map_err(|error| anyhow::anyhow!("Can not get all of displays. {}", error))?;
|
||||
|
@ -3,7 +3,6 @@ use std::{io::ErrorKind::WouldBlock, time::Duration, thread};
|
||||
|
||||
pub struct Screen {
|
||||
capturer: Option<Capturer>,
|
||||
init_error: Option<anyhow::Error>,
|
||||
pub width: usize,
|
||||
pub height: usize,
|
||||
}
|
||||
@ -12,16 +11,6 @@ impl Screen {
|
||||
pub fn new(capturer: Capturer, width: usize, height: usize) -> Self {
|
||||
Self {
|
||||
capturer: Some(capturer),
|
||||
init_error: None,
|
||||
width,
|
||||
height,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_failed(init_error: anyhow::Error, width: usize, height: usize) -> Self {
|
||||
Self {
|
||||
capturer: None,
|
||||
init_error: Some(init_error),
|
||||
width,
|
||||
height,
|
||||
}
|
||||
|
Reference in New Issue
Block a user