pingcap / talent-plan

open source training courses about distributed database and distributed systems
https://tidb.io/talent-plan
10.19k stars 1.32k forks source link

courses/rust/projects/project-4/README.md Updates signature of Threadpool::new #406

Open kkwteh opened 2 years ago

kkwteh commented 2 years ago

This update is needed, because the current signature as given in the README is rejected by the compile with the message:

the size for values of type `(dyn ThreadPool + 'static)` cannot be known at compilation time
the trait `Sized` is not implemented for `(dyn ThreadPool + 'static)`rustcE0277
result.rs(503, 17): required by a bound in `std::result::Result`

What is changed and how it works?

I changed the return value from Result<ThreadPool> to Result<Self> where Self: Sized, which matches the trait definition in the code

Check List