Implement `Debug` for `ViewRepr`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 4.3k
- Fork
- 391
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rust-ndarray/ndarray
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
rust-ndarray/ndarray#1612 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
rust-ndarray/ndarray#1617 · 1 bình luận ·
-
Stack overflow in `triu` Đang mởbug good first issue
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
rust-ndarray/ndarray#1615 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
rust-ndarray/ndarray#1610 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
rust-ndarray/ndarray#1609 ·
Tất cả issue của rust-ndarray/ndarray
Issue tương tự
-
risk:low runtime status:in-progress type:test
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
EricSpencer00/Resilient#4835 · 1 bình luận ·
-
agent:ready documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
cesarferreira/stax#890 ·
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100