Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental Ordinals Support #267

Merged
merged 5 commits into from
May 4, 2024

Inscription Example

387e990
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

Experimental Ordinals Support #267

Inscription Example
387e990
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy succeeded May 4, 2024 in 2s

clippy

137 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 137
Note 0
Help 0

Versions

  • rustc 1.80.0-nightly (d2d24e395 2024-05-03)
  • cargo 1.80.0-nightly (6087566b3 2024-04-30)
  • clippy 0.1.80 (d2d24e3 2024-05-03)

Annotations

Check warning on line 48 in cli/src/contracts/server.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
  --> cli/src/contracts/server.rs:48:25
   |
48 |                         resp.send(req.handle().await);
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this `Result` may be an `Err` variant, which should be handled
   = note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
   |
48 |                         let _ = resp.send(req.handle().await);
   |                         +++++++

Check warning on line 317 in cli/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> cli/src/main.rs:317:70
    |
317 |                     std::fs::write(args.value_of_os("out").unwrap(), &base64::encode(bytes))?;
    |                                                                      ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `base64::encode(bytes)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 267 in cli/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> cli/src/main.rs:267:46
    |
267 |                     std::fs::write(file_out, &base64::encode(bytes))?;
    |                                              ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `base64::encode(bytes)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 52 in cli/src/util.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
  --> cli/src/util.rs:46:25
   |
46 |           &base64::decode(&if let Some(psbt) = psbt_str {
   |  _________________________^
47 | |             psbt.into()
48 | |         } else {
49 | |             let mut s = String::new();
50 | |             tokio::io::stdin().read_to_string(&mut s).await?;
51 | |             s
52 | |         })?[..],
   | |_________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
   = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
   |
46 ~         &base64::decode(if let Some(psbt) = psbt_str {
47 +             psbt.into()
48 +         } else {
49 +             let mut s = String::new();
50 +             tokio::io::stdin().read_to_string(&mut s).await?;
51 +             s
52 ~         })?[..],
   |

Check warning on line 30 in cli/src/contracts/server.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
  --> cli/src/contracts/server.rs:26:21
   |
26 |       pub fn new() -> (
   |  _____________________^
27 | |         Self,
28 | |         UnboundedSender<(Request, oneshot::Sender<Response>)>,
29 | |         broadcast::Sender<()>,
30 | |     ) {
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
   = note: `#[warn(clippy::type_complexity)]` on by default

Check warning on line 342 in cli/src/contracts/request.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting to the same type is unnecessary (`u32` -> `u32`)

warning: casting to the same type is unnecessary (`u32` -> `u32`)
   --> cli/src/contracts/request.rs:342:38
    |
342 |             OutPoint::new(tx.txid(), vout as u32),
    |                                      ^^^^^^^^^^^ help: try: `vout`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    = note: `#[warn(clippy::unnecessary_cast)]` on by default

Check warning on line 105 in cli/src/config.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&PathBuf` instead of `&Path` involves a new object where a slice will do

warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
   --> cli/src/config.rs:105:28
    |
105 |     pub fn serialize<S>(p: &PathBuf, s: S) -> Result<S::Ok, S::Error>
    |                            ^^^^^^^^ help: change this to: `&Path`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
    = note: `#[warn(clippy::ptr_arg)]` on by default

Check warning on line 96 in cli/src/config.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
  --> cli/src/config.rs:96:1
   |
96 | impl Into<PathBuf> for PathBufWrapped {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
           https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
   = note: `#[warn(clippy::from_over_into)]` on by default
help: replace the `Into` implementation with `From<config::PathBufWrapped>`
   |
96 ~ impl From<PathBufWrapped> for PathBuf {
97 ~     fn from(val: PathBufWrapped) -> Self {
98 ~         val.0
   |

Check warning on line 31 in cli/src/contracts/request.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `Write`

warning: unused import: `Write`
  --> cli/src/contracts/request.rs:31:36
   |
31 | use std::fmt::{Display, Formatter, Write};
   |                                    ^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

Check warning on line 362 in plugins/src/host/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/mod.rs:358:9
    |
358 | /         env.memory
359 | |             .as_ref()
360 | |             .unwrap()
361 | |             .view(&store)
362 | |             .write(bytes as u64, s.as_bytes());
    | |______________________________________________^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
358 |         let _ = env.memory
    |         +++++++

Check warning on line 347 in plugins/src/host/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/mod.rs:343:9
    |
343 | /         env.memory
344 | |             .as_ref()
345 | |             .unwrap()
346 | |             .view(&store)
347 | |             .read(psbt, &mut buf[..]);
    | |_____________________________________^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
343 |         let _ = env.memory
    |         +++++++

Check warning on line 330 in plugins/src/host/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/mod.rs:326:9
    |
326 | /         env.memory
327 | |             .as_ref()
328 | |             .unwrap()
329 | |             .view(&store)
330 | |             .write(bytes as u64, s.as_bytes());
    | |______________________________________________^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
326 |         let _ = env.memory
    |         +++++++

Check warning on line 315 in plugins/src/host/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/mod.rs:311:13
    |
311 | /             env.memory
312 | |                 .as_ref()
313 | |                 .unwrap()
314 | |                 .view(&store)
315 | |                 .read(hash, &mut buf[..]);
    | |_________________________________________^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
311 |             let _ = env.memory
    |             +++++++

Check warning on line 298 in plugins/src/host/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/mod.rs:298:9
    |
298 |         w.write_all(&v[..]);
    |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
298 |         let _ = w.write_all(&v[..]);
    |         +++++++

Check warning on line 297 in plugins/src/host/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/mod.rs:297:9
    |
297 |         mem.read(a as u64, &mut v[..]);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
297 |         let _ = mem.read(a as u64, &mut v[..]);
    |         +++++++

Check warning on line 280 in plugins/src/host/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/mod.rs:276:21
    |
276 | /                     env.memory
277 | |                         .as_ref()
278 | |                         .unwrap()
279 | |                         .view(&store)
280 | |                         .write(bytes as u64, comp_s.as_bytes());
    | |_______________________________________________________________^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
276 |                     let _ = env.memory
    |                     +++++++

Check warning on line 212 in plugins/src/host/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/mod.rs:208:17
    |
208 | /                 env.memory
209 | |                     .as_ref()
210 | |                     .unwrap()
211 | |                     .view(&store)
212 | |                     .read(path as u64, &mut v[..path_len as usize]);
    | |___________________________________________________________________^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
208 |                 let _ = env.memory
    |                 +++++++

Check warning on line 202 in plugins/src/host/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/mod.rs:198:17
    |
198 | /                 env.memory
199 | |                     .as_ref()
200 | |                     .unwrap()
201 | |                     .view(&store)
202 | |                     .read(json as u64, &mut v[..json_len as usize]);
    | |___________________________________________________________________^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
198 |                 let _ = env.memory
    |                 +++++++

Check warning on line 175 in plugins/src/host/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/mod.rs:171:13
    |
171 | /             env.memory
172 | |                 .as_ref()
173 | |                 .unwrap()
174 | |                 .view(&store)
175 | |                 .read(key, &mut buf[..]);
    | |________________________________________^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
171 |             let _ = env.memory
    |             +++++++

Check warning on line 114 in plugins/src/host/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/mod.rs:110:9
    |
110 | /         env.memory
111 | |             .as_ref()
112 | |             .unwrap()
113 | |             .view(&store)
114 | |             .write_u8(ok as u64, is_ok);
    | |_______________________________________^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
110 |         let _ = env.memory
    |         +++++++

Check warning on line 105 in plugins/src/host/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/mod.rs:101:13
    |
101 | /             env.memory
102 | |                 .as_ref()
103 | |                 .unwrap()
104 | |                 .view(&store)
105 | |                 .write(out as u64, b);
    | |_____________________________________^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
101 |             let _ = env.memory
    |             +++++++

Check warning on line 96 in plugins/src/host/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
  --> plugins/src/host/mod.rs:92:17
   |
92 | /                 env.memory
93 | |                     .as_ref()
94 | |                     .unwrap()
95 | |                     .view(&store)
96 | |                     .read(key as u64, &mut buf[..]);
   | |___________________________________________________^
   |
   = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
   |
92 |                 let _ = env.memory
   |                 +++++++

Check warning on line 223 in plugins/src/host/plugin_handle/wasm.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/plugin_handle/wasm.rs:223:9
    |
223 |         mem.read(p, &mut v[..]);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
223 |         let _ = mem.read(p, &mut v[..]);
    |         +++++++

Check warning on line 197 in plugins/src/host/plugin_handle/wasm.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> plugins/src/host/plugin_handle/wasm.rs:191:9
    |
191 | /         env.memory
192 | |             .as_ref()
193 | |             .ok_or(CompilationError::ModuleFailedToGetMemory(
194 | |                 "Memory Missing".into(),
195 | |             ))?
196 | |             .view(&self.store)
197 | |             .write(offset as u64, &s.as_bytes()[..]);
    | |____________________________________________________^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
    = note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
    |
191 |         let _ = env.memory
    |         +++++++

Check warning on line 47 in plugins/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `API<Input, Output>`

warning: you should consider adding a `Default` implementation for `API<Input, Output>`
  --> plugins/src/lib.rs:41:5
   |
41 | /     pub fn new() -> Self {
42 | |         API {
43 | |             arguments: schemars::schema_for!(Input),
44 | |             returns: schemars::schema_for!(Output),
45 | |             _pd: Default::default(),
46 | |         }
47 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
   = note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
   |
35 + impl<Input, Output> Default for API<Input, Output>
36 + where
37 +     Input: JsonSchema,
38 +     Output: JsonSchema,
39 +  {
40 +     fn default() -> Self {
41 +         Self::new()
42 +     }
43 + }
   |