Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
Cargo fmt and update
Browse files Browse the repository at this point in the history
  • Loading branch information
NGnius committed Mar 16, 2022
1 parent 2e75abd commit 494537a
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 81 deletions.
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions mps-interpreter/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::fmt::{Debug, Display, Error, Formatter};
use std::convert::From;
use std::fmt::{Debug, Display, Error, Formatter};

use crate::lang::{SyntaxError, RuntimeError, MpsLanguageError};
use crate::lang::{MpsLanguageError, RuntimeError, SyntaxError};
use crate::tokens::ParseError;

#[derive(Debug)]
Expand Down
5 changes: 2 additions & 3 deletions mps-interpreter/src/interpretor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::path::Path;
use super::lang::{MpsLanguageDictionary, MpsLanguageError, MpsOp};
use super::tokens::MpsToken;
use super::MpsContext;
use super::MpsItem;
use super::MpsError;
use super::MpsItem;

/// The script interpreter.
/// Use MpsRunner for a better interface.
Expand Down Expand Up @@ -91,8 +91,7 @@ where
if next_item.is_none() {
is_stmt_done = true;
}
next_item
.map(|item| item.map_err(|e| error_with_ctx(e, self.tokenizer.current_line())))
next_item.map(|item| item.map_err(|e| error_with_ctx(e, self.tokenizer.current_line())))
} else {
/*if self.tokenizer.end_of_file() {
return None;
Expand Down
4 changes: 2 additions & 2 deletions mps-interpreter/src/lang/iter_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,12 @@ fn find_last_open_curly(tokens: &VecDeque<MpsToken>) -> Option<usize> {
if bracket_depth == 0 && curly_found {
return Some(i + 1);
}
},
}
MpsToken::OpenBracket | MpsToken::CloseBracket => {
if bracket_depth == 0 {
return None;
}
},
}
_ => {}
}
if token.is_open_curly() {
Expand Down
2 changes: 1 addition & 1 deletion mps-interpreter/src/lang/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ mod type_primitives;
pub(crate) mod utility;

pub use dictionary::MpsLanguageDictionary;
pub use error::{RuntimeError, RuntimeMsg, RuntimeOp, SyntaxError};
pub(crate) use error::MpsLanguageError;
pub use error::{RuntimeError, RuntimeMsg, RuntimeOp, SyntaxError};
pub use filter::{
MpsFilterFactory, MpsFilterPredicate, MpsFilterStatement, MpsFilterStatementFactory,
};
Expand Down
2 changes: 1 addition & 1 deletion mps-interpreter/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::iter::Iterator;

use super::lang::MpsLanguageDictionary;
use super::tokens::{MpsTokenReader, MpsTokenizer};
use super::{MpsContext, MpsInterpretor, MpsItem, MpsError};
use super::{MpsContext, MpsError, MpsInterpretor, MpsItem};

pub struct MpsRunnerSettings<T: MpsTokenReader> {
pub vocabulary: MpsLanguageDictionary,
Expand Down
2 changes: 1 addition & 1 deletion mps-interpreter/tests/single_line.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use mps_interpreter::MpsError;
use mps_interpreter::tokens::{MpsToken, MpsTokenizer, ParseError};
use mps_interpreter::MpsError;
use mps_interpreter::*;
use std::collections::VecDeque;
use std::io::Cursor;
Expand Down
5 changes: 4 additions & 1 deletion mps-player/src/os_controls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ impl SystemControlWrapper {

fn enqueued(item: MpsItem, dbus_ctrl: &Sender<DbusControl>) {
//println!("Got enqueued item {}", &item.title);
let file_uri = item.field("filename").and_then(|x| x.to_owned().to_str()).map(|x| format!("file://{}", x));
let file_uri = item
.field("filename")
.and_then(|x| x.to_owned().to_str())
.map(|x| format!("file://{}", x));
dbus_ctrl
.send(DbusControl::SetMetadata(Metadata {
length: None,
Expand Down
Loading

0 comments on commit 494537a

Please sign in to comment.