Skip to content

Commit

Permalink
apply cargo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Krusty/Benediction committed Nov 11, 2024
1 parent ca83e20 commit 69b05de
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
1 change: 1 addition & 0 deletions cpclib-asm/src/assembler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ pub trait MyDefault {
}

/// Several passes are needed to properly assemble a source file.
///
/// This structure allows to code which pass is going to be analysed.
/// First pass consists in collecting the various labels to manipulate and so on. Some labels stay unknown at this moment.
/// Second pass serves to get the final values
Expand Down
1 change: 1 addition & 0 deletions cpclib-asm/src/implementation/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub fn ensure_orgams_type(e: ExprResult, env: &Env) -> Result<ExprResult, Assemb

/// ! Add all important methods to expresison-like structure sthat are not availalbe in the cpclib_tokens crate.

///
/// The result of expression (without taking into account the strings) is either a int (no complex mathematical expression) or a float (division/sinus and so on)

/// Evaluate an expression
Expand Down
1 change: 1 addition & 0 deletions cpclib-asm/src/orgams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ pub fn convert_from<P: AsRef<Utf8Path>>(p: P) -> Result<String, ToOrgamsError> {
}

/// COnvert a basm txt source file as a orgams text source file.
///
/// There are tons of current limitations. I have only implemented what I need
/// TODO - convert expressions to be orgams compatible. REwrite them ? Write parenthesis ?
/// TODO - rewrite macros
Expand Down
6 changes: 0 additions & 6 deletions cpclib-bndbuild/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ use cpclib_common::camino::{Utf8Path, Utf8PathBuf};
use cpclib_common::clap;
use cpclib_common::clap::*;
use cpclib_common::itertools::Itertools;
use cpclib_runner::emucontrol::EMUCTRL_CMD;
use cpclib_runner::runner::assembler::{RASM_CMD, SJASMPLUS_CMD};
use cpclib_runner::runner::emulator::{AMSPIRIT_CMD, CPCEC_CMD, SUGARBOX_V2_CMD, WINAPE_CMD};
use cpclib_runner::runner::impdisc::IMPDISC_CMD;
use cpclib_runner::runner::martine::MARTINE_CMD;
use lazy_regex::regex_captures;
use runners::hideur::HIDEUR_CMD;
use task::{ACE_CMDS, AMSPIRIT_CMDS, BASM_CMDS, BNDBUILD_CMDS, CPCEC_CMDS, CP_CMDS, DISC_CMDS, ECHO_CMDS, EMUCTRL_CMDS, EXTERN_CMDS, FAP_CMDS, HIDEUR_CMDS, IMG2CPC_CMDS, IMPDISC_CMDS, MARTINE_CMDS, ORGAMS_CMDS, RASM_CMDS, RM_CMDS, SJASMPLUS_CMDS, SUGARBOX_CMDS, VASM_CMDS, WINAPE_CMDS, XFER_CMDS};
use thiserror::Error;

Expand Down
4 changes: 4 additions & 0 deletions cpclib-disc/src/edsk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ impl From<&Head> for u8 {
/// Disc image files consist of a 0x100-byte disc info block and for each track a 0x100-byte track info block, followed by the data for every sector in that track. The new extended disk format is intended for some copy protected disks. Parts which are new in the extended format are marked with "*E*" (from our "Extended DISK Format Proposal, Rev.5").
///
///
///
///
///
///
/// The Disc Information block
/// Byte (Hex): Meaning:
/// 00 - 21 "MV - CPCEMU Disk-File\r\nDisk-Info\r\n"
Expand Down
3 changes: 2 additions & 1 deletion cpclib-image/src/pixels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,8 @@ pub mod mode0 {
}

/// Generate the needed table to write a masked sprite on screen when mask_pen corresponds to the pen of the background.
/// Code for the display
///
/// Code for the display
/// ld e, sprite byte to display
/// ld d, mask_table / 256
/// ld a, (de) ; get the mask
Expand Down
11 changes: 5 additions & 6 deletions cpclib-runner/src/delegated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub trait CompilableInformation {
if let Some(commands) = self.target_os_commands() {
let install : Box<dyn Fn(&Utf8Path, &E) -> Result<(), String>> = Box::new(|_path: &Utf8Path, o: &E| -> Result<(), String>{
for command in commands.iter() {
ExternRunner::default().inner_run(&command, o)?;
ExternRunner::default().inner_run(command, o)?;
}
Ok(())
});
Expand Down Expand Up @@ -131,7 +131,7 @@ pub trait StaticInformation: DownloadableInformation {
let url = self.target_os_url();
let deferred: Box<dyn Fn() -> Result<String, String>> = Box::new(move || {
url
.ok_or_else(|| format!("No download url for current OS"))
.ok_or_else(|| "No download url for current OS".to_string())
.map(|s| s.to_owned())

});
Expand Down Expand Up @@ -160,7 +160,7 @@ pub trait DynamicUrlInformation : DownloadableInformation + Clone + 'static{
let urls = inside.dynamic_download_urls()?;
urls.target_os_url()
.cloned()
.ok_or(format!("No url for this os"))
.ok_or("No url for this os".to_string())
});
deferred.into()
}
Expand Down Expand Up @@ -190,7 +190,7 @@ pub trait GithubInformation : DownloadableInformation + Display + Clone +'static
let urls = inside.github_download_urls()?;
urls.target_os_url()
.cloned()
.ok_or(format!("No url for this os"))
.ok_or("No url for this os".to_string())
});
deferred.into()
}
Expand Down Expand Up @@ -439,10 +439,9 @@ impl<E: EventObserver> DelegateApplicationDescription<E> {

pub fn install(&self, o: &E) -> Result<(), String> {
self.inner_install(o)
.map_err(|e| {
.inspect_err(|e| {
let dest = self.cache_folder();
let _ = std::fs::remove_dir_all(dest); // ignore error
e
})

}
Expand Down
4 changes: 2 additions & 2 deletions cpclib-runner/src/runner/emulator/ace.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::collections::BTreeMap;

use cpclib_common::{camino::Utf8PathBuf, event::EventObserver};
use cpclib_common::camino::Utf8PathBuf;
use directories::BaseDirs;
use scraper::{Html, Selector};

use crate::delegated::{cpclib_download, ArchiveFormat, DelegateApplicationDescription, DownloadableInformation, DynamicUrlInformation, ExecutableInformation, InternetDynamicCompiledApplication, MutiplatformUrls, UrlGenerator};
use crate::delegated::{cpclib_download, ArchiveFormat, DownloadableInformation, DynamicUrlInformation, ExecutableInformation, InternetDynamicCompiledApplication, MutiplatformUrls};

pub const ACE_CMD: &str = "ace";

Expand Down
4 changes: 2 additions & 2 deletions cpclib-runner/src/runner/emulator/cpcec.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::sync::OnceLock;

use cpclib_common::{camino::Utf8PathBuf, event::EventObserver};
use cpclib_common::camino::Utf8PathBuf;

use crate::delegated::{ArchiveFormat, DelegateApplicationDescription, DownloadableInformation, ExecutableInformation, InternetStaticCompiledApplication, MutiplatformUrls, StaticInformation};
use crate::delegated::{ArchiveFormat, DownloadableInformation, ExecutableInformation, InternetStaticCompiledApplication, MutiplatformUrls, StaticInformation};

pub const CPCEC_CMD: &str = "cpcec";

Expand Down
3 changes: 1 addition & 2 deletions cpclib-runner/src/runner/emulator/sugarbox.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::fmt::Display;

use cpclib_common::event::EventObserver;

use crate::{delegated::{ArchiveFormat, CompilableInformation, DelegateApplicationDescription, DownloadableInformation, ExecutableInformation, GithubCompilableApplication, GithubCompiledApplication, GithubInformation, MutiplatformUrls}, runner::runner::RunInDir};
use crate::{delegated::{ArchiveFormat, DownloadableInformation, ExecutableInformation, GithubCompiledApplication, GithubInformation}, runner::runner::RunInDir};


pub const SUGARBOX_V2_CMD: &str = "sugarbox";
Expand Down
4 changes: 2 additions & 2 deletions cpclib-runner/src/runner/emulator/winape.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::sync::OnceLock;

use cpclib_common::{camino::Utf8PathBuf, event::EventObserver};
use cpclib_common::camino::Utf8PathBuf;

use crate::delegated::{ArchiveFormat, DelegateApplicationDescription, DownloadableInformation, ExecutableInformation, InternetStaticCompiledApplication, MutiplatformUrls, StaticInformation};
use crate::delegated::{ArchiveFormat, DownloadableInformation, ExecutableInformation, InternetStaticCompiledApplication, MutiplatformUrls, StaticInformation};

pub const WINAPE_CMD: &str = "winape";

Expand Down

0 comments on commit 69b05de

Please sign in to comment.