Skip to content

Commit c4c162f

Browse files
committed
SourceFile::into_directive() doesn't need a failure result.
Also enable the unnecessary_wraps Clippy warning now that the code doesn't produce those.
1 parent 712b37a commit c4c162f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

assembler/src/asmlib/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ fn assemble_pass2<'s>(
394394
}
395395
}
396396

397-
let directive = source_file.into_directive(&memory_map)?;
397+
let directive = source_file.into_directive(&memory_map);
398398
if let Some(instruction_count) = directive
399399
.blocks
400400
.values()

assembler/src/asmlib/lexer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ impl Display for Token {
247247
write!(f, "{q_string}{dotname}{bit_string}")
248248
}
249249
Token::SymexSyllable(script, name) => {
250+
#[allow(clippy::unnecessary_wraps)]
250251
fn nochange(ch: char) -> Result<char, ()> {
251252
Ok(ch)
252253
}

assembler/src/asmlib/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#![warn(clippy::items_after_statements)]
1313
#![warn(clippy::explicit_iter_loop)]
1414
#![warn(clippy::unreadable_literal)]
15+
#![warn(clippy::redundant_closure_for_method_calls)]
1516
#![warn(clippy::pedantic)]
1617
#![allow(clippy::enum_glob_use)] // fix later
1718
#![allow(clippy::redundant_else)] // fix later
@@ -25,8 +26,7 @@
2526
#![allow(clippy::doc_markdown)] // fix soon
2627
#![allow(clippy::match_wildcard_for_single_variants)] // fix soon
2728
#![allow(clippy::trivially_copy_pass_by_ref)] // fix soon
28-
#![allow(clippy::unnecessary_wraps)] // fix soon
29-
#![warn(clippy::redundant_closure_for_method_calls)]
29+
#![warn(clippy::unnecessary_wraps)] // fix soon
3030

3131
mod ast;
3232
mod collections;

assembler/src/asmlib/manuscript.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ use super::symtab::ExplicitDefinition;
4444
use super::symtab::ExplicitSymbolTable;
4545
#[cfg(test)]
4646
use super::symtab::TagDefinition;
47-
use super::types::AssemblerFailure;
4847
use super::types::BlockIdentifier;
4948

5049
fn offset_to_block_id<T>((offset, item): (usize, T)) -> (BlockIdentifier, T) {
@@ -148,7 +147,7 @@ impl SourceFile {
148147
self.symbol_uses().filter_map(definitions_only)
149148
}
150149

151-
pub(crate) fn into_directive(self, mem_map: &MemoryMap) -> Result<Directive, AssemblerFailure> {
150+
pub(crate) fn into_directive(self, mem_map: &MemoryMap) -> Directive {
152151
let SourceFile {
153152
punch,
154153
blocks: input_blocks,
@@ -211,7 +210,7 @@ impl SourceFile {
211210
// answers for right now. For example, should the
212211
// existing program be cleared? Should the symbol
213212
// table be cleared?
214-
Ok(Directive::new(output_blocks, equalities, entry_point))
213+
Directive::new(output_blocks, equalities, entry_point)
215214
}
216215
}
217216

0 commit comments

Comments
 (0)