Skip to content

Can't use PointExt methods in custom implementation #46

@berkut0

Description

@berkut0

I'm trying something like:

impl<P> CustomPoint<P> where P: Point {
    fn new(cenet: P, size: f64) {
        let p = center.add( value );
        ...
    }
}

and it drops the error: items from traits can only be used if the trait is in scope

In 'rstar-demo' there is an example:

pub fn create_random_points<P: Point<Scalar = f32>>(num_points: usize) -> Vec<P>

and it's works, but the same doesn't work for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions