Skip to content

Commit

Permalink
Merge pull request #509 from hidekuno/fix-clippy-1.80.1
Browse files Browse the repository at this point in the history
fix clippy 1.80.1
  • Loading branch information
hidekuno authored Aug 26, 2024
2 parents bb442d3 + d52b931 commit ed22654
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 43 deletions.
1 change: 1 addition & 0 deletions elisp/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ mod error_tests {
assert_eq!(do_lisp("(load-file hoge)"), "E1008");
assert_eq!(do_lisp("(load-file #t)"), "E1015");
assert_eq!(do_lisp("(load-file \"/etc/test.scm\")"), "E1014");
assert_eq!(do_lisp("(load-file \"/etc/shadow\")"), "E1014");
assert_eq!(do_lisp("(load-file \"/tmp\")"), "E1016");
assert_eq!(do_lisp("(load-file \"/bin/cp\")"), "E9999");
}
Expand Down
4 changes: 2 additions & 2 deletions elisp/src/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ impl Div for Number {
fn div(self, other: Number) -> Number {
if let (Number::Integer(x), Number::Integer(y)) = (self, other) {
if x == 0 && y == 0 {
return Number::Float(std::f64::NAN);
return Number::Float(f64::NAN);
}
if y == 0 {
return Number::Float(std::f64::INFINITY);
return Number::Float(f64::INFINITY);
}
if 0 != (x % y) {
return self
Expand Down
72 changes: 42 additions & 30 deletions glisp/Cargo.lock

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

1 change: 1 addition & 0 deletions glisp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "cairo
surf = "2.1.0"
serde = { version = "1.0", features = ["derive"] }
async-std = { version = "1.5.0", features = ["attributes"] }
wasm-bindgen="0.2.88"

[features]
animation = []
Expand Down
6 changes: 1 addition & 5 deletions weblisp/examples/webasync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,7 @@ async fn main() {

builder
.format(|buf, record| {
let m = if let Some(m) = record.module_path() {
m
} else {
""
};
let m = record.module_path().unwrap_or_default();
writeln!(
buf,
"{} {:<6} {:<20} - {}",
Expand Down
6 changes: 1 addition & 5 deletions weblisp/src/bin/weblisp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let mut builder = Builder::from_default_env();
builder
.format(|buf, record| {
let m = if let Some(m) = record.module_path() {
m
} else {
""
};
let m = record.module_path().unwrap_or_default();
writeln!(
buf,
"{} {:<6} {:<20} - {}",
Expand Down
2 changes: 1 addition & 1 deletion weblisp/src/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ pub fn parse_request(buffer: &[u8]) -> Result<Request, Box<WebError>> {
} else {
return Err(Box::new(WebError::UriParse(line!())));
};
let mut parameter = if let Some(s) = iter.next() { s } else { "" };
let mut parameter = iter.next().unwrap_or_default();
let mut headers = Vec::new();
let mut body = String::from("");
let mut header = true;
Expand Down

0 comments on commit ed22654

Please sign in to comment.