Implement `Debug` for `ViewRepr`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by locating the ViewRepr definition and its existing trait implementations. Implement the requested Debug support, then verify that the generic example in the issue compiles and that formatting a view works as shown.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Basically if you ever try to write a function that is generic over any array subtype (ArrayView, Array etc), then you aren't able to use debug features, because ViewRepr doesn't implement Debug:
use ndarray::*;
use core::fmt::Debug;
fn print_arr<S: Data<Elem=T> + Debug, T: Debug>(array: &ArrayBase<S, Ix1>){
dbg!(array);
}
fn main(){
let arr = array![1, 2, 3];
print_arr(&arr);
print_arr(&arr.view());
}
print_arr(&arr.view());
^^^^^^^^^^^ `ViewRepr<&{integer}>` cannot be formatted using `{:?}` because it doesn't implement `Debug`
`ViewRepr<&{integer}>` doesn't implement `Debug`
help: the trait `Debug` is not implemented for `ViewRepr<&{integer}>`
Here's a playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=9754536345631a70374f14d3703050cf.
Happy to write a PR but it looks like PR review is pretty slow at the moment so I'll hold off until this issue has been approved.
- Lingua principale
- Rust
- Stelle
- 4.3k
- Fork
- 391
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-ndarray/ndarray
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
rust-ndarray/ndarray#1612 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rust-ndarray/ndarray#1617 · 1 commento ·
-
Stack overflow in `triu` Apertabug good first issue
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
rust-ndarray/ndarray#1615 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rust-ndarray/ndarray#1610 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
rust-ndarray/ndarray#1609 ·
Tutte le issue di rust-ndarray/ndarray
Issue simili
-
Accept -c in more positions Apertaarea: compat bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
area: dogs bug priority: P3 silent failure test-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
MystenLabs/sui#28056 · 1 commento ·
-
type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Luminous-Dynamics/mycelix#2577 ·